From abe80e50be7a35e16dd2c80931f264b123ed0750 Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Tue, 10 Feb 2026 23:55:26 +0100 Subject: [PATCH 01/21] migrated pem.xml configs to workflow plugins --- .mvn/extensions.xml | 2 +- java-utils-maven3-ext/pom.xml | 7 - pem.xml | 476 ---------------------------------- pom.xml | 49 ++-- 4 files changed, 33 insertions(+), 501 deletions(-) delete mode 100644 pem.xml diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml index e983533..4e99a7c 100644 --- a/.mvn/extensions.xml +++ b/.mvn/extensions.xml @@ -22,6 +22,6 @@ net.runeduniverse.tools.maven.r4m r4m-maven-extension - 1.0.1 + 1.1.1 diff --git a/java-utils-maven3-ext/pom.xml b/java-utils-maven3-ext/pom.xml index c3aa4af..070b535 100644 --- a/java-utils-maven3-ext/pom.xml +++ b/java-utils-maven3-ext/pom.xml @@ -175,13 +175,6 @@ src/main/plexus src/test/plexus - - - - generate-metadata - - - org.apache.maven.plugins diff --git a/pem.xml b/pem.xml deleted file mode 100644 index acf3e04..0000000 --- a/pem.xml +++ /dev/null @@ -1,476 +0,0 @@ - - - 1.0.0 - - - - - - - - - - - - - - net.runeduniverse.tools.maven.r4m - r4m-maven-extension - - - - - - - net.runeduniverse.tools.maven.r4m - r4m-maven-extension - - - - - - - - - - - - - - - org.apache.maven.plugins - maven-clean-plugin - - - - - - - - - - - - - - - - - - - com.mycila - license-maven-plugin - - - - - - - org.apache.maven.plugins - maven-install-plugin - - - - - - - - - - - - - - - org.apache.maven.plugins - maven-site-plugin - - - - - - - - - - - org.apache.maven.plugins - maven-site-plugin - - - - - - - - - - - - - - - - - - - - - - - net.runeduniverse.tools.maven.r4m - r4m-maven-extension - - - - - - - - - - - - - - - - - - org.apache.maven.plugins - maven-clean-plugin - - - - - - - - - - - - - - - org.apache.maven.plugins - maven-toolchains-plugin - - - - - - com.mycila - license-maven-plugin - - - - - - net.revelc.code.formatter - formatter-maven-plugin - - - - - - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - - - - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - - - - - - - - org.apache.maven.plugins - maven-install-plugin - - - - - - - - - - - org.apache.maven.plugins - maven-site-plugin - - - - - - - - - - - org.apache.maven.plugins - maven-site-plugin - - - - - - - - - - - - - - - - - - - - jar - - - - - - - - - - - net.revelc.code.formatter - formatter-maven-plugin - - - - - - org.apache.maven.plugins - maven-toolchains-plugin - - - - - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - - - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - - - - - - - - - - - jar - - - - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - - - org.apache.maven.plugins - maven-source-plugin - - - - - - org.apache.maven.plugins - maven-source-plugin - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - - - - - - - - - - - jar - - - - - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.codehaus.plexus - plexus-component-metadata - - - - - - - - - - - - - - - - - - jar - - - - - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - - - - - - - diff --git a/pom.xml b/pom.xml index 8604c0a..cfe22b3 100644 --- a/pom.xml +++ b/pom.xml @@ -118,11 +118,15 @@ 3.0.0-M1 2.23.0 4.2.rc1 + + 0.1.0 + 0.1.0 1.8.2 1.8.2 5.8.2 5.8.2 + @@ -142,7 +146,7 @@ openjdk-1.8.0 - clean dev/install] + clean dev/install @@ -159,12 +163,12 @@ format - dev/validate + dev/[validate] - debug + ci-debug false @@ -173,30 +177,30 @@ - validate + ci-validate check/[validate]@pipeline - install + ci-install - clean@pipeline - install/install]@pipeline + install/clean@pipeline + install/install@pipeline - build-tests + ci-test-build - junit/test-compile]@pipeline + junit/]test@pipeline - test-junit-jupiter + ci-test-exec junit/validate@pipeline @@ -404,13 +408,6 @@ org.apache.maven.plugins maven-toolchains-plugin - - - - toolchain - - - net.revelc.code.formatter @@ -440,6 +437,14 @@ org.apache.maven.plugins maven-install-plugin + + net.runeduniverse.tools.maven.workflow + maven-pipeline-workflow + + + net.runeduniverse.tools.maven.workflow + maven-java-workflow + @@ -595,6 +600,16 @@ maven-install-plugin ${plugin-maven-install-version} + + net.runeduniverse.tools.maven.workflow + maven-pipeline-workflow + ${plugin-workflow-pipeline-version} + + + net.runeduniverse.tools.maven.workflow + maven-java-workflow + ${plugin-workflow-java-version} + From d8220311a27855f8b6d58b9e8d13789a26e13e99 Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Tue, 10 Feb 2026 23:59:33 +0100 Subject: [PATCH 02/21] updated date --- java-utils-async-api/pom.xml | 2 +- .../net/runeduniverse/lib/utils/async/api/IChainable.java | 2 +- .../net/runeduniverse/lib/utils/async/api/ICreateable.java | 2 +- .../java/net/runeduniverse/lib/utils/async/api/IRegistry.java | 2 +- .../net/runeduniverse/lib/utils/async/api/IThreadable.java | 2 +- java-utils-async/pom.xml | 2 +- .../main/java/net/runeduniverse/lib/utils/async/AChain.java | 2 +- .../java/net/runeduniverse/lib/utils/async/ChainableTask.java | 2 +- .../java/net/runeduniverse/lib/utils/async/CleanupTask.java | 2 +- .../main/java/net/runeduniverse/lib/utils/async/Pipeline.java | 2 +- .../java/net/runeduniverse/lib/utils/async/ThreadPool.java | 2 +- .../main/java/net/runeduniverse/lib/utils/async/Trigger.java | 2 +- .../java/net/runeduniverse/lib/utils/async/TriggerMap.java | 2 +- .../net/runeduniverse/lib/utils/async/TriggeredParamTask.java | 2 +- .../runeduniverse/lib/utils/async/TriggeredParamTaskMap.java | 2 +- .../net/runeduniverse/lib/utils/async/test/ChainTest.java | 2 +- java-utils-bom/pom.xml | 2 +- java-utils-chain-api/pom.xml | 2 +- .../java/net/runeduniverse/lib/utils/chain/api/Chain.java | 2 +- .../net/runeduniverse/lib/utils/chain/api/ChainRuntime.java | 2 +- .../lib/utils/chain/api/ChainRuntimeExecutionTrace.java | 2 +- .../java/net/runeduniverse/lib/utils/chain/api/Chains.java | 2 +- .../java/net/runeduniverse/lib/utils/chain/api/Layer.java | 2 +- java-utils-chain/pom.xml | 2 +- .../net/runeduniverse/lib/utils/chain/BaseChainLayer.java | 2 +- .../net/runeduniverse/lib/utils/chain/ChainContainer.java | 2 +- .../java/net/runeduniverse/lib/utils/chain/ChainLayer.java | 2 +- .../java/net/runeduniverse/lib/utils/chain/ChainLogger.java | 2 +- .../java/net/runeduniverse/lib/utils/chain/ChainManager.java | 2 +- .../runeduniverse/lib/utils/chain/DefaultChainRuntime.java | 2 +- .../lib/utils/chain/DefaultChainRuntimeExecutionTrace.java | 2 +- .../main/java/net/runeduniverse/lib/utils/chain/Level.java | 2 +- .../main/java/net/runeduniverse/lib/utils/chain/Store.java | 2 +- .../lib/utils/chain/errors/ChainLayerCallException.java | 2 +- .../runeduniverse/lib/utils/chain/test/ChainManagerTest.java | 2 +- .../net/runeduniverse/lib/utils/chain/test/model/AEntity.java | 2 +- .../runeduniverse/lib/utils/chain/test/model/Inventory.java | 2 +- .../net/runeduniverse/lib/utils/chain/test/model/Item.java | 2 +- .../net/runeduniverse/lib/utils/chain/test/model/Player.java | 2 +- .../lib/utils/chain/test/model/relations/ARelationEntity.java | 2 +- .../lib/utils/chain/test/model/relations/Slot.java | 2 +- java-utils-common-api/pom.xml | 2 +- .../java/net/runeduniverse/lib/utils/common/api/DataMap.java | 2 +- .../java/net/runeduniverse/lib/utils/common/api/Keyed.java | 2 +- .../net/runeduniverse/lib/utils/common/api/TriConsumer.java | 2 +- java-utils-common/pom.xml | 2 +- .../net/runeduniverse/lib/utils/common/AbstractDataMap.java | 2 +- .../net/runeduniverse/lib/utils/common/CollectionUtils.java | 2 +- .../net/runeduniverse/lib/utils/common/ComparisonUtils.java | 2 +- .../java/net/runeduniverse/lib/utils/common/HashDataMap.java | 2 +- .../java/net/runeduniverse/lib/utils/common/HashUtils.java | 2 +- .../net/runeduniverse/lib/utils/common/LinkedHashDataMap.java | 2 +- .../net/runeduniverse/lib/utils/common/ReflectionUtils.java | 2 +- .../java/net/runeduniverse/lib/utils/common/StringUtils.java | 2 +- .../lib/utils/common/StringVariableGenerator.java | 2 +- java-utils-conditional-api/pom.xml | 2 +- .../runeduniverse/lib/utils/conditional/api/Condition.java | 2 +- .../lib/utils/conditional/api/ConditionGroup.java | 2 +- .../lib/utils/conditional/api/ConditionModifier.java | 2 +- java-utils-conditional/pom.xml | 2 +- .../net/runeduniverse/lib/utils/conditional/ACondition.java | 2 +- .../runeduniverse/lib/utils/conditional/AConditionGroup.java | 2 +- .../lib/utils/conditional/AConditionModifier.java | 2 +- .../net/runeduniverse/lib/utils/conditional/AndCondition.java | 2 +- .../lib/utils/conditional/DefaultConditionInfo.java | 2 +- .../net/runeduniverse/lib/utils/conditional/NotCondition.java | 2 +- .../net/runeduniverse/lib/utils/conditional/OrCondition.java | 2 +- .../net/runeduniverse/lib/utils/conditional/tool/Checker.java | 2 +- .../lib/utils/conditional/tool/ConditionComparator.java | 2 +- .../lib/utils/conditional/tool/ConditionIndexer.java | 2 +- .../lib/utils/conditional/tool/IndexedRelationEntrySet.java | 2 +- .../lib/utils/conditional/tool/RelationEntry.java | 2 +- .../lib/utils/conditional/tool/RelationEntrySet.java | 2 +- .../lib/utils/conditional/test/model/ModelFactory.java | 2 +- .../lib/utils/conditional/test/model/MvnGoalCondition.java | 2 +- .../lib/utils/conditional/test/model/MvnGoalView.java | 2 +- .../lib/utils/conditional/tools/test/CheckerTest.java | 2 +- .../utils/conditional/tools/test/ConditionComparatorTest.java | 2 +- java-utils-config-api/pom.xml | 2 +- .../java/net/runeduniverse/lib/utils/config/api/Property.java | 2 +- .../net/runeduniverse/lib/utils/config/api/PropertyStore.java | 2 +- java-utils-config/pom.xml | 2 +- .../net/runeduniverse/lib/utils/config/APropertyStore.java | 2 +- .../net/runeduniverse/lib/utils/config/AbstractProperty.java | 2 +- .../net/runeduniverse/lib/utils/config/ConfigBuilder.java | 2 +- .../net/runeduniverse/lib/utils/config/test/package-info.java | 2 +- java-utils-errors/pom.xml | 2 +- .../runeduniverse/lib/utils/error/ATrunkableException.java | 2 +- .../runeduniverse/lib/utils/error/ExceptionSuppressions.java | 2 +- .../net/runeduniverse/lib/utils/error/test/package-info.java | 2 +- java-utils-logging-api/pom.xml | 2 +- .../runeduniverse/lib/utils/logging/log/api/CompoundTree.java | 2 +- .../lib/utils/logging/log/api/CompoundTreeStyle.java | 2 +- .../runeduniverse/lib/utils/logging/log/api/LineRecord.java | 2 +- .../net/runeduniverse/lib/utils/logging/log/api/LogEntry.java | 2 +- .../runeduniverse/lib/utils/logging/log/api/Recordable.java | 2 +- .../runeduniverse/lib/utils/logging/log/api/TreeRecord.java | 2 +- java-utils-logging/pom.xml | 2 +- .../java/net/runeduniverse/lib/utils/logging/ALogger.java | 2 +- .../java/net/runeduniverse/lib/utils/logging/DebugLogger.java | 2 +- .../main/java/net/runeduniverse/lib/utils/logging/Level.java | 2 +- .../net/runeduniverse/lib/utils/logging/UniversalLogger.java | 2 +- .../lib/utils/logging/log/DefaultCompoundTree.java | 2 +- .../lib/utils/logging/log/DefaultLineRecord.java | 2 +- .../lib/utils/logging/log/DefaultTreeRecord.java | 2 +- .../net/runeduniverse/lib/utils/logging/log/LineEntry.java | 2 +- .../lib/utils/logging/log/SortedCompoundTree.java | 2 +- .../runeduniverse/lib/utils/logging/log/SortedTreeRecord.java | 2 +- .../net/runeduniverse/lib/utils/logging/test/TreeTest.java | 2 +- java-utils-maven3-api/pom.xml | 2 +- .../runeduniverse/lib/utils/maven3/api/MavenProperties.java | 2 +- java-utils-maven3-ext-api/pom.xml | 2 +- .../lib/utils/maven3/ext/api/ExtensionIndex.java | 2 +- .../runeduniverse/lib/utils/maven3/ext/api/ExtensionTool.java | 2 +- .../lib/utils/maven3/ext/data/api/Extension.java | 2 +- .../lib/utils/maven3/ext/data/api/ExtensionData.java | 2 +- .../lib/utils/maven3/ext/data/api/PluginData.java | 2 +- .../maven3/ext/eventspy/api/EventSpyDispatcherProxy.java | 2 +- .../lib/utils/maven3/ext/indexer/api/PluginBoundRegistry.java | 2 +- .../lib/utils/maven3/ext/indexer/api/ProjectBoundEntry.java | 2 +- .../utils/maven3/ext/indexer/api/ProjectBoundRegistry.java | 2 +- java-utils-maven3-ext/pom.xml | 2 +- .../lib/utils/maven3/ext/DefaultExtensionIndex.java | 2 +- .../lib/utils/maven3/ext/DefaultExtensionTool.java | 2 +- .../runeduniverse/lib/utils/maven3/ext/MvnCorePatcher.java | 2 +- .../lib/utils/maven3/ext/config/ConfigBuilder.java | 2 +- .../lib/utils/maven3/ext/data/DefaultExtension.java | 2 +- .../lib/utils/maven3/ext/data/UnmodifiableExtensionData.java | 2 +- .../lib/utils/maven3/ext/data/UnmodifiablePluginData.java | 2 +- .../maven3/ext/eventspy/DefaultEventSpyDispatcherProxy.java | 2 +- .../lib/utils/maven3/ext/indexer/APluginBoundRegistry.java | 2 +- .../lib/utils/maven3/ext/indexer/AProjectBoundArchive.java | 2 +- .../lib/utils/maven3/ext/indexer/AProjectBoundEntry.java | 2 +- .../lib/utils/maven3/ext/indexer/AProjectBoundRegistry.java | 2 +- .../runeduniverse/lib/utils/maven3/ext/test/package-info.java | 2 +- java-utils-maven3/pom.xml | 2 +- .../java/net/runeduniverse/lib/utils/maven3/PluginUtils.java | 2 +- .../runeduniverse/lib/utils/maven3/SessionContextUtils.java | 2 +- .../net/runeduniverse/lib/utils/maven3/test/package-info.java | 2 +- java-utils-plexus/pom.xml | 2 +- .../runeduniverse/lib/utils/plexus/PlexusContextUtils.java | 2 +- .../net/runeduniverse/lib/utils/plexus/test/package-info.java | 2 +- java-utils-scanner-api/pom.xml | 2 +- .../net/runeduniverse/lib/utils/scanner/api/FieldScanner.java | 2 +- .../runeduniverse/lib/utils/scanner/api/MethodScanner.java | 2 +- .../net/runeduniverse/lib/utils/scanner/api/TypeScanner.java | 2 +- .../lib/utils/scanner/debug/api/Intercepter.java | 2 +- .../lib/utils/scanner/pattern/api/FieldPattern.java | 2 +- .../lib/utils/scanner/pattern/api/MethodPattern.java | 2 +- .../lib/utils/scanner/pattern/api/TypePattern.java | 2 +- java-utils-scanner/pom.xml | 2 +- .../net/runeduniverse/lib/utils/scanner/PackageScanner.java | 2 +- .../lib/utils/scanner/debug/DefaultIntercepter.java | 2 +- .../lib/utils/scanner/debug/IntercepterSection.java | 2 +- .../lib/utils/scanner/pattern/DefaultFieldPattern.java | 2 +- .../lib/utils/scanner/pattern/DefaultMethodPattern.java | 2 +- .../lib/utils/scanner/pattern/DefaultTypePattern.java | 2 +- .../scanner/templates/DefaultFieldAnnotationScanner.java | 2 +- .../lib/utils/scanner/templates/DefaultFieldScanner.java | 2 +- .../scanner/templates/DefaultMethodAnnotationScanner.java | 2 +- .../lib/utils/scanner/templates/DefaultMethodScanner.java | 2 +- .../utils/scanner/templates/DefaultTypeAnnotationScanner.java | 2 +- .../lib/utils/scanner/templates/DefaultTypeScanner.java | 2 +- .../runeduniverse/lib/utils/scanner/templates/ScanOrder.java | 2 +- .../lib/utils/scanner/test/PackageScannerTest.java | 2 +- .../lib/utils/scanner/test/annotations/FirstField.java | 2 +- .../lib/utils/scanner/test/annotations/FirstMethod.java | 2 +- .../lib/utils/scanner/test/annotations/LastField.java | 2 +- .../lib/utils/scanner/test/annotations/LastMethod.java | 2 +- .../lib/utils/scanner/test/annotations/LivingEntity.java | 2 +- .../runeduniverse/lib/utils/scanner/test/model/APerson.java | 2 +- .../net/runeduniverse/lib/utils/scanner/test/model/Emmy.java | 2 +- .../net/runeduniverse/lib/utils/scanner/test/model/Frank.java | 2 +- pom.xml | 4 ++-- 174 files changed, 175 insertions(+), 175 deletions(-) diff --git a/java-utils-async-api/pom.xml b/java-utils-async-api/pom.xml index bf05ef4..d28b780 100644 --- a/java-utils-async-api/pom.xml +++ b/java-utils-async-api/pom.xml @@ -1,6 +1,6 @@ + repo-development @@ -245,6 +253,14 @@ + + + runeduniverse-development + + https://nexus.runeduniverse.net/repository/maven-development/ + + + From c7efcd7a35858aa7748ba10dcf164269e5a768d4 Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Wed, 11 Feb 2026 19:23:39 +0100 Subject: [PATCH 06/21] changed maven pre-caching in Jenkinsfile --- Jenkinsfile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3f6f805..1228639 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -112,12 +112,18 @@ node( label: 'linux' ) { } stage('Update Maven Repo') { + echo 'purging local maven repository' + sh "mvn-dev -P ${ REPOS } dependency:purge-local-repository -DactTransitively=false -DreResolve=false" + + echo 'caching validation dependencies' + sh "mvn-dev -P ${ REPOS },ci-validate dependency:go-offline -U --fail-never" + if(checkAllModules(match: 'all', active: false)) { - skipStage() - return + echo 'skipping build dependency download » unused' + } else { + echo 'caching build dependencies' + sh "mvn-dev -P ${ REPOS },ci-install dependency:go-offline -U --fail-never" } - sh "mvn-dev -P ${ REPOS } dependency:purge-local-repository -DactTransitively=false -DreResolve=false" - sh "mvn-dev -P ${ REPOS },ci-install,ci-validate dependency:go-offline -U --fail-never" } stage('Code Validation') { From 3236bd05c3d3fa999108ce4a3d2f7c5cd0c0ea28 Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Wed, 11 Feb 2026 19:57:10 +0100 Subject: [PATCH 07/21] changed maven pre-caching in Jenkinsfile (2) --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1228639..4270c44 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -116,13 +116,13 @@ node( label: 'linux' ) { sh "mvn-dev -P ${ REPOS } dependency:purge-local-repository -DactTransitively=false -DreResolve=false" echo 'caching validation dependencies' - sh "mvn-dev -P ${ REPOS },ci-validate dependency:go-offline -U --fail-never" + sh "mvn-dev -P ${ REPOS },ci-validate dependency:resolve-plugins dependency:resolve -U --fail-never" if(checkAllModules(match: 'all', active: false)) { echo 'skipping build dependency download » unused' } else { echo 'caching build dependencies' - sh "mvn-dev -P ${ REPOS },ci-install dependency:go-offline -U --fail-never" + sh "mvn-dev -P ${ REPOS },ci-install dependency:resolve -U --fail-never" } } From f66a17a8588469175bd5c7bf69e83f639446d96d Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Fri, 13 Feb 2026 02:16:45 +0100 Subject: [PATCH 08/21] fixed unit test execution in Jenkins --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 3e7354a..b03381e 100644 --- a/pom.xml +++ b/pom.xml @@ -195,7 +195,7 @@ ci-test-build - junit/]test@pipeline + test/]test@pipeline @@ -203,8 +203,8 @@ ci-test-exec - junit/validate@pipeline - junit/test@pipeline + test/validate@pipeline + test/test@pipeline From 585f977bac97373a3a63ab4c5e7c7e5e55e307c7 Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Fri, 13 Feb 2026 02:34:06 +0100 Subject: [PATCH 09/21] updated Jenkinsfile --- Jenkinsfile | 118 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 71 insertions(+), 47 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4270c44..bea7a63 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,22 +1,29 @@ -def evalValue(expression, path) { +def evalValue(expression, path = null) { return sh( returnStdout: true, - script: "mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=${ expression } -q -DforceStdout -pl=${ path } | tail -1") + script: "mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=${ expression } -q -DforceStdout ${ path==null ? '' : ('-pl='+path) } | tail -1") } -def installArtifact(mod) { +def getToolchainId(mod) { + if(mod.hasTag('jdk-11')) + return 'toolchain-openjdk-11'; + return 'toolchain-openjdk-1-8-0'; +} + +def installArtifact(mod, parent = null) { if(!mod.active()) { skipStage() return } + def relPath = (parent == null ? '.' : mod.relPathFrom(parent)) // get module metadata - def groupId = evalValue('project.groupId', mod.relPathFrom('maven-parent')) - def artifactId = evalValue('project.artifactId', mod.relPathFrom('maven-parent')) - def version = evalValue('project.version', mod.relPathFrom('maven-parent')) + def groupId = evalValue('project.groupId', relPath) + def artifactId = evalValue('project.artifactId', relPath) + def version = evalValue('project.version', relPath) echo "Building: ${ groupId }:${ artifactId }:${ version }" try { - sh "mvn-dev -P ${ REPOS },toolchain-openjdk-1-8-0,ci-install -pl=${ mod.relPathFrom('maven-parent') }" + sh "mvn-dev -P ${ REPOS },${ getToolchainId(mod) },ci-install -pl=${ relPath }" } finally { - def baseName="${ artifactId }-${ version }" + def baseName = "${ artifactId }-${ version }" // create spec .pom in target/ path sh "cp -T '${ mod.path() }/pom.xml' '${ mod.path() }/target/${ baseName }.pom'" // archive artifacts @@ -45,6 +52,26 @@ def installArtifact(mod) { } } +def testArtifacts(toolchainId, tag, parent) { + stage(tag) { + def mods = getModules(withTags: [ 'test', tag ]); + + if(!mods) { + skipStage() + return + } + + def modPaths = mods.collect({ it.relPathFrom(parent) }).join(','); + sh "mvn-dev -P ${ REPOS },${ toolchainId },ci-test-build -pl=${ modPaths }" + sh "mvn-dev --fail-never -P ${ REPOS },${ toolchainId },ci-test-exec,test-system -pl=${ modPaths }" + // check tests, archive reports in case junit flags errors + junit '*/target/surefire-reports/*.xml' + if(currentBuild.resultIsWorseOrEqualTo('UNSTABLE')) { + archiveArtifacts artifacts: '*/target/surefire-reports/*.xml' + } + } +} + node( label: 'linux' ) { withModules { tool(name: 'maven-latest', type: 'maven') @@ -72,27 +99,28 @@ node( label: 'linux' ) { addModule id: 'maven-parent', path: '.', name: 'Maven Parent', tags: [ 'parent' ] addModule id: 'java-utils-bom', path: 'java-utils-bom', name: 'Bill of Materials', tags: [ 'bom' ] - addModule id: 'java-utils-async-api', path: 'java-utils-async-api', name: 'Java Async Utils [API]', tags: [ 'build1a', 'pack-jar' ] - addModule id: 'java-utils-async', path: 'java-utils-async', name: 'Java Async Utils', tags: [ 'test', 'build1', 'pack-jar' ] - addModule id: 'java-utils-chain-api', path: 'java-utils-chain-api', name: 'Java Chain Library [API]', tags: [ 'build2a', 'pack-jar' ] - addModule id: 'java-utils-chain', path: 'java-utils-chain', name: 'Java Chain Library', tags: [ 'test', 'build2', 'pack-jar' ] - addModule id: 'java-utils-common-api', path: 'java-utils-common-api', name: 'Java Common Utils [API]', tags: [ 'build1a', 'pack-jar' ] - addModule id: 'java-utils-common', path: 'java-utils-common', name: 'Java Common Utils', tags: [ 'test', 'build1', 'pack-jar' ] - addModule id: 'java-utils-conditional-api', path: 'java-utils-conditional-api', name: 'Java Conditional Utils [API]', tags: [ 'build2a', 'pack-jar' ] - addModule id: 'java-utils-conditional', path: 'java-utils-conditional', name: 'Java Conditional Utils', tags: [ 'test', 'build2', 'pack-jar' ] - addModule id: 'java-utils-config-api', path: 'java-utils-config-api', name: 'Java Config Utils [API]', tags: [ 'build1a', 'pack-jar' ] - addModule id: 'java-utils-config', path: 'java-utils-config', name: 'Java Config Utils', tags: [ 'test', 'build1', 'pack-jar' ] - addModule id: 'java-utils-errors', path: 'java-utils-errors', name: 'Java Error Handling Library', tags: [ 'test', 'build1', 'pack-jar' ] - addModule id: 'java-utils-logging-api', path: 'java-utils-logging-api', name: 'Java Logging Tools [API]', tags: [ 'build1a', 'pack-jar' ] - addModule id: 'java-utils-logging', path: 'java-utils-logging', name: 'Java Logging Tools', tags: [ 'test', 'build1', 'pack-jar' ] - addModule id: 'java-utils-maven3-api', path: 'java-utils-maven3-api', name: 'Java Maven3 Utils [API]', tags: [ 'build1a', 'pack-jar' ] - addModule id: 'java-utils-maven3', path: 'java-utils-maven3', name: 'Java Maven3 Utils', tags: [ 'test', 'build1', 'pack-jar' ] - addModule id: 'java-utils-maven3-ext-api', path: 'java-utils-maven3-ext-api', name: 'Java Maven3 Extension Utils [API]', tags: [ 'build3a', 'pack-jar' ] - addModule id: 'java-utils-maven3-ext', path: 'java-utils-maven3-ext', name: 'Java Maven3 Extension Utils', tags: [ 'test', 'build3', 'pack-jar' ] - addModule id: 'java-utils-plexus', path: 'java-utils-plexus', name: 'Java Plexus Utils', tags: [ 'test', 'build2', 'pack-jar' ] - addModule id: 'java-utils-scanner-api', path: 'java-utils-scanner-api', name: 'Java Scanner [API]', tags: [ 'build2a', 'pack-jar' ] - addModule id: 'java-utils-scanner', path: 'java-utils-scanner', name: 'Java Scanner', tags: [ 'test', 'build2', 'pack-jar' ] + addModule id: 'java-utils-async-api', path: 'java-utils-async-api', name: 'Java Async Utils [API]', tags: [ 'build1a', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-async', path: 'java-utils-async', name: 'Java Async Utils', tags: [ 'test', 'build1', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-chain-api', path: 'java-utils-chain-api', name: 'Java Chain Library [API]', tags: [ 'build2a', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-chain', path: 'java-utils-chain', name: 'Java Chain Library', tags: [ 'test', 'build2', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-common-api', path: 'java-utils-common-api', name: 'Java Common Utils [API]', tags: [ 'build1a', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-common', path: 'java-utils-common', name: 'Java Common Utils', tags: [ 'test', 'build1', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-conditional-api', path: 'java-utils-conditional-api', name: 'Java Conditional Utils [API]', tags: [ 'build2a', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-conditional', path: 'java-utils-conditional', name: 'Java Conditional Utils', tags: [ 'test', 'build2', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-config-api', path: 'java-utils-config-api', name: 'Java Config Utils [API]', tags: [ 'build1a', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-config', path: 'java-utils-config', name: 'Java Config Utils', tags: [ 'test', 'build1', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-errors', path: 'java-utils-errors', name: 'Java Error Handling Library', tags: [ 'test', 'build1', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-logging-api', path: 'java-utils-logging-api', name: 'Java Logging Tools [API]', tags: [ 'build1a', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-logging', path: 'java-utils-logging', name: 'Java Logging Tools', tags: [ 'test', 'build1', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-maven3-api', path: 'java-utils-maven3-api', name: 'Java Maven3 Utils [API]', tags: [ 'build1a', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-maven3', path: 'java-utils-maven3', name: 'Java Maven3 Utils', tags: [ 'test', 'build1', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-maven3-ext-api', path: 'java-utils-maven3-ext-api', name: 'Java Maven3 Extension Utils [API]', tags: [ 'build3a', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-maven3-ext', path: 'java-utils-maven3-ext', name: 'Java Maven3 Extension Utils', tags: [ 'test', 'build3', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-plexus', path: 'java-utils-plexus', name: 'Java Plexus Utils', tags: [ 'test', 'build2', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-scanner-api', path: 'java-utils-scanner-api', name: 'Java Scanner [API]', tags: [ 'build2a', 'pack-jar', 'jdk-1.8.0' ] + addModule id: 'java-utils-scanner', path: 'java-utils-scanner', name: 'Java Scanner', tags: [ 'test', 'build2', 'pack-jar', 'jdk-1.8.0' ] } + def parentMod = getModule(id: 'maven-parent'); stage('Init Modules') { sshagent (credentials: ['RunedUniverse-Jenkins']) { @@ -101,7 +129,7 @@ node( label: 'linux' ) { mod.activate( !mod.hasTag('skip') && sh( returnStdout: true, - script: "git-check-version-tag ${ mod.id() } ${ mod.relPathFrom('maven-parent') }" + script: "git-check-version-tag ${ mod.id() } ${ mod.relPathFrom(parentMod) }" ) == '1' ); } @@ -132,36 +160,36 @@ node( label: 'linux' ) { bundleContext { stage('Install Maven Parent') { - installArtifact( getModule(id: 'maven-parent') ); + installArtifact( parentMod ); } stage('Install - BOMs') { perModule(withTagIn: [ 'bom' ]) { - installArtifact( module ); + installArtifact( getModule(), parentMod ); } } stage('Build [1st Level]') { perModule(withTagIn: [ 'build1a' ]) { - installArtifact( module ); + installArtifact( getModule(), parentMod ); } perModule(withTagIn: [ 'build1' ]) { - installArtifact( module ); + installArtifact( getModule(), parentMod ); } } stage('Build [2nd Level]') { perModule(withTagIn: [ 'build2a' ]) { - installArtifact( module ); + installArtifact( getModule(), parentMod ); } perModule(withTagIn: [ 'build2' ]) { - installArtifact( module ); + installArtifact( getModule(), parentMod ); } } stage('Build [3rd Level]') { perModule(withTagIn: [ 'build3a' ]) { - installArtifact( module ); + installArtifact( getModule(), parentMod ); } perModule(withTagIn: [ 'build3' ]) { - installArtifact( module ); + installArtifact( getModule(), parentMod ); } } @@ -170,13 +198,9 @@ node( label: 'linux' ) { skipStage() return } - sh "mvn-dev -P ${ REPOS },toolchain-openjdk-1-8-0,ci-test-build" - sh "mvn-dev --fail-never -P ${ REPOS },toolchain-openjdk-1-8-0,ci-test-exec,test-system" - // check tests, archive reports in case junit flags errors - junit '*/target/surefire-reports/*.xml' - if(currentBuild.resultIsWorseOrEqualTo('UNSTABLE')) { - archiveArtifacts artifacts: '*/target/surefire-reports/*.xml' - } + + testArtifacts('toolchain-openjdk-1-8-0', 'jdk-1.8.0', parentMod); + testArtifacts('toolchain-openjdk-11', 'jdk-11', parentMod); } stage('Package Build Result') { @@ -215,9 +239,9 @@ node( label: 'linux' ) { return } deployArtifacts( bundle: mod.id(), repo: 'nexus-runeduniverse>maven-releases' ) - def groupId = evalValue('project.groupId', mod.relPathFrom('maven-parent')) - def artifactId = evalValue('project.artifactId', mod.relPathFrom('maven-parent')) - def version = evalValue('project.version', mod.relPathFrom('maven-parent')) + def groupId = evalValue('project.groupId', mod.relPathFrom(parentMod)) + def artifactId = evalValue('project.artifactId', mod.relPathFrom(parentMod)) + def version = evalValue('project.version', mod.relPathFrom(parentMod)) sshagent (credentials: ['RunedUniverse-Jenkins']) { sh "git tag -a ${ mod.id() }/v${ version } -f -m '[artifact] ${ groupId }:${ artifactId }:${ version }'" sh "git push origin ${ mod.id() }/v${ version }" From 22a6f9a9e1b0406ef6ece907c6b1dda9147e8d47 Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Sun, 15 Feb 2026 22:25:19 +0100 Subject: [PATCH 10/21] [java-utils-common] fixed bugs in CollectionUtils & added unit tests for CollectionUtils --- java-utils-common/pom.xml | 2 +- .../lib/utils/common/CollectionUtils.java | 6 +- .../common/test/CollectionUtilsTest.java | 122 ++++++++++++++++++ 3 files changed, 126 insertions(+), 4 deletions(-) create mode 100644 java-utils-common/src/test/java/net/runeduniverse/lib/utils/common/test/CollectionUtilsTest.java diff --git a/java-utils-common/pom.xml b/java-utils-common/pom.xml index d2e74b0..ed89381 100644 --- a/java-utils-common/pom.xml +++ b/java-utils-common/pom.xml @@ -27,7 +27,7 @@ utils-common - 2.0.0 + 2.0.1 jar Java Common Utils diff --git a/java-utils-common/src/main/java/net/runeduniverse/lib/utils/common/CollectionUtils.java b/java-utils-common/src/main/java/net/runeduniverse/lib/utils/common/CollectionUtils.java index e8f5be1..a38de3c 100644 --- a/java-utils-common/src/main/java/net/runeduniverse/lib/utils/common/CollectionUtils.java +++ b/java-utils-common/src/main/java/net/runeduniverse/lib/utils/common/CollectionUtils.java @@ -50,8 +50,8 @@ public static final T last(final Collection collection) { return deque.getLast(); } for (Iterator i = collection.iterator(); i.hasNext();) { - boolean next = i.hasNext(); final T obj = (T) i.next(); + boolean next = i.hasNext(); if (!next) return obj; } @@ -72,12 +72,12 @@ public static final T lastNotNull(final Collection collection) { // otherwise search everything T value = null; for (Iterator i = collection.iterator(); i.hasNext();) { - boolean next = i.hasNext(); final T obj = (T) i.next(); + boolean next = i.hasNext(); if (obj != null) value = obj; if (!next) - return obj; + return value; } return value; } diff --git a/java-utils-common/src/test/java/net/runeduniverse/lib/utils/common/test/CollectionUtilsTest.java b/java-utils-common/src/test/java/net/runeduniverse/lib/utils/common/test/CollectionUtilsTest.java new file mode 100644 index 0000000..f3dab2e --- /dev/null +++ b/java-utils-common/src/test/java/net/runeduniverse/lib/utils/common/test/CollectionUtilsTest.java @@ -0,0 +1,122 @@ +/* + * Copyright © 2026 VenaNocta (venanocta@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package net.runeduniverse.lib.utils.common.test; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; + +import net.runeduniverse.lib.utils.common.CollectionUtils; + +public class CollectionUtilsTest { + + protected final List list1; + protected final List list2; + + protected final Set set1; + + protected final Map map1; + + public CollectionUtilsTest() { + // seed test data + + this.list1 = Arrays.asList(// + "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", // + "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"); + this.list2 = Arrays.asList(// + null, "a", "b", "c", "d", "e", null, "f", "g", "h", "i", "j", "k", "l", "m", // + "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", null, "z", null, null); + + this.set1 = new HashSet(this.list1); + + this.map1 = new HashMap<>(); + for (int i = 0; i < 26; i++) { + this.map1.put(i, "" + (char) ('a' + i)); + } + } + + @Test + @Tag("system") + public void first_1() throws InterruptedException { + Assertions.assertEquals("a", CollectionUtils.first(this.list1)); + } + + @Test + @Tag("system") + public void firstNotNull_1() throws InterruptedException { + Assertions.assertEquals("a", CollectionUtils.firstNotNull(this.list2)); + } + + @Test + @Tag("system") + public void last_1() throws InterruptedException { + Assertions.assertEquals("z", CollectionUtils.last(this.list1)); + } + + @Test + @Tag("system") + public void lastNotNull_1() throws InterruptedException { + Assertions.assertEquals("z", CollectionUtils.lastNotNull(this.list2)); + } + + @Test + @Tag("system") + public void copy_list_1() throws InterruptedException { + List obj = CollectionUtils.copy(this.list1, LinkedList::new); + + Assertions.assertInstanceOf(LinkedList.class, obj); + Assertions.assertTrue(this.list1.containsAll(obj) && obj.containsAll(this.list1)); + } + + @Test + @Tag("system") + public void copy_set_1() throws InterruptedException { + Set obj = CollectionUtils.copy(this.set1, LinkedHashSet::new); + + Assertions.assertInstanceOf(LinkedHashSet.class, obj); + Assertions.assertTrue(this.set1.containsAll(obj) && obj.containsAll(this.set1)); + } + + @Test + @Tag("system") + public void copy_map_1() throws InterruptedException { + Map obj = CollectionUtils.copy(this.map1, LinkedHashMap::new); + + Assertions.assertInstanceOf(LinkedHashMap.class, obj); + + Set> entriesMap1 = this.map1.entrySet(); + Set> entriesObj = this.map1.entrySet(); + Assertions.assertTrue(entriesMap1.containsAll(entriesObj) && entriesObj.containsAll(entriesMap1)); + + Assertions.assertEquals("e", this.map1.get(4)); + Assertions.assertEquals("e", obj.get(4)); + Assertions.assertEquals("z", this.map1.get(25)); + Assertions.assertEquals("z", obj.get(25)); + Assertions.assertEquals(null, this.map1.get(26)); + Assertions.assertEquals(null, obj.get(26)); + } +} From 1fa04d57ecd08813fb1c1a13209f04b72f7c2a6f Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Sun, 15 Feb 2026 22:45:50 +0100 Subject: [PATCH 11/21] updated ci pipeline --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b03381e..bca2257 100644 --- a/pom.xml +++ b/pom.xml @@ -204,7 +204,7 @@ test/validate@pipeline - test/test@pipeline + test/[test]@pipeline From ec03c55e0784a35d934242ec16d6505188df79d1 Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Sun, 15 Feb 2026 23:05:30 +0100 Subject: [PATCH 12/21] [java-utils-bom] updated bom version --- java-utils-bom/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java-utils-bom/pom.xml b/java-utils-bom/pom.xml index 22e2275..d550736 100644 --- a/java-utils-bom/pom.xml +++ b/java-utils-bom/pom.xml @@ -27,7 +27,7 @@ utils-bom - 2.0.0 + 2.0.1 pom UTILS - Bill of Materials @@ -80,7 +80,7 @@ 2.0.0 2.0.0 2.0.0 - 2.0.0 + 2.0.1 2.0.0 2.0.0 2.0.0 From 2e324af55031a0f2a3cce9c1c49a141d96777456 Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Sun, 15 Feb 2026 23:40:24 +0100 Subject: [PATCH 13/21] added build helper file .build/update-pom-property --- .build/update-pom-property | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 .build/update-pom-property diff --git a/.build/update-pom-property b/.build/update-pom-property new file mode 100755 index 0000000..026d371 --- /dev/null +++ b/.build/update-pom-property @@ -0,0 +1,25 @@ +#!/usr/bin/sh + +set -e + +if [ $# -lt 2 ] || [ $# -gt 3 ]; then + printf "Usage: %s [path]\n" "$0" + printf " path defaults to current directory\n" + exit 1 +fi + +PROP_NAME="$1" +NEW_VALUE="$2" +SEARCH_PATH="${3:-.}" + +find "$SEARCH_PATH" \ + \( -type d -name src -o -type d -name target \) -prune -o \ + -type f -name pom.xml -print | +while read -r pom; do + sed -i \ + "s|\(<[[:space:]]*${PROP_NAME}[[:space:]]*>[[:space:]]*\)[^<]*\([[:space:]]*\)|\1${NEW_VALUE}\2|g" \ + "$pom" +done + +printf "Updated %s to %s under %s\n" "${PROP_NAME}" "${NEW_VALUE}" "${SEARCH_PATH}" + From 9e24ed9b0ff64a1d305c3f77a29815e0845d2fd9 Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Mon, 16 Feb 2026 00:09:25 +0100 Subject: [PATCH 14/21] added maven-dependency-plugin to workflow --- pom.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bca2257..9e5d403 100644 --- a/pom.xml +++ b/pom.xml @@ -107,6 +107,7 @@ 1.18.12 1.7.1 + 3.10.0 3.1.0 3.1.0 3.2.0 @@ -126,7 +127,6 @@ 1.8.2 5.8.2 5.8.2 - @@ -417,6 +417,10 @@ + + org.apache.maven.plugins + maven-dependency-plugin + org.apache.maven.plugins maven-clean-plugin @@ -464,6 +468,11 @@ + + org.apache.maven.plugins + maven-dependency-plugin + ${plugin-maven-dependency-version} + org.apache.maven.plugins maven-clean-plugin From 3d01436ec8c6dafbcf47b68dba83743c4cc27e9b Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Mon, 16 Feb 2026 00:30:00 +0100 Subject: [PATCH 15/21] added forced BOM update for testing to Jenkinsfile --- Jenkinsfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index bea7a63..213a321 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -121,6 +121,7 @@ node( label: 'linux' ) { addModule id: 'java-utils-scanner', path: 'java-utils-scanner', name: 'Java Scanner', tags: [ 'test', 'build2', 'pack-jar', 'jdk-1.8.0' ] } def parentMod = getModule(id: 'maven-parent'); + def bomMod = getModule(id: 'java-utils-bom'); stage('Init Modules') { sshagent (credentials: ['RunedUniverse-Jenkins']) { @@ -199,6 +200,10 @@ node( label: 'linux' ) { return } + echo 'force update bom version for tests -> test for possible collisions caused by this update' + def bomVersion = evalValue('project.version', bomMod.relPathFrom(parentMod)) + sh "update-pom-property 'runeduniverse-utils-bom-version' '${ bomVersion }'" + testArtifacts('toolchain-openjdk-1-8-0', 'jdk-1.8.0', parentMod); testArtifacts('toolchain-openjdk-11', 'jdk-11', parentMod); } From c980fa86c257180a1b6387b7c235c61402e8ede6 Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Mon, 16 Feb 2026 00:53:26 +0100 Subject: [PATCH 16/21] changed bom force update for tests to user defined override --- Jenkinsfile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 213a321..27a4f99 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -52,7 +52,7 @@ def installArtifact(mod, parent = null) { } } -def testArtifacts(toolchainId, tag, parent) { +def testArtifacts(toolchainId, tag, parent, flags = []) { stage(tag) { def mods = getModules(withTags: [ 'test', tag ]); @@ -62,8 +62,10 @@ def testArtifacts(toolchainId, tag, parent) { } def modPaths = mods.collect({ it.relPathFrom(parent) }).join(','); - sh "mvn-dev -P ${ REPOS },${ toolchainId },ci-test-build -pl=${ modPaths }" - sh "mvn-dev --fail-never -P ${ REPOS },${ toolchainId },ci-test-exec,test-system -pl=${ modPaths }" + def testFlags = flags.collect({ "-D${ it }" }).join(' '); + + sh "mvn-dev -P ${ REPOS },${ toolchainId },ci-test-build -pl=${ modPaths } ${ testFlags }" + sh "mvn-dev --fail-never -P ${ REPOS },${ toolchainId },ci-test-exec,test-system -pl=${ modPaths } ${ testFlags }" // check tests, archive reports in case junit flags errors junit '*/target/surefire-reports/*.xml' if(currentBuild.resultIsWorseOrEqualTo('UNSTABLE')) { @@ -201,11 +203,11 @@ node( label: 'linux' ) { } echo 'force update bom version for tests -> test for possible collisions caused by this update' - def bomVersion = evalValue('project.version', bomMod.relPathFrom(parentMod)) - sh "update-pom-property 'runeduniverse-utils-bom-version' '${ bomVersion }'" + def bomVersion = evalValue('project.version', bomMod.relPathFrom(parentMod)); + def flags = [ "runeduniverse-utils-bom-version=${ bomVersion }" ]; - testArtifacts('toolchain-openjdk-1-8-0', 'jdk-1.8.0', parentMod); - testArtifacts('toolchain-openjdk-11', 'jdk-11', parentMod); + testArtifacts('toolchain-openjdk-1-8-0', 'jdk-1.8.0', parentMod, flags); + testArtifacts('toolchain-openjdk-11', 'jdk-11', parentMod, flags); } stage('Package Build Result') { From fc38388d159feba202e9b09863e9f076a6c48f3b Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Mon, 16 Feb 2026 01:53:11 +0100 Subject: [PATCH 17/21] [java-utils-common] updated bom version --- java-utils-common/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-utils-common/pom.xml b/java-utils-common/pom.xml index ed89381..c1d8576 100644 --- a/java-utils-common/pom.xml +++ b/java-utils-common/pom.xml @@ -79,7 +79,7 @@ 1.8 - 2.0.0 + 2.0.1 From 288c883faf45325849bcd8b4f070678ea3f6952d Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Fri, 20 Feb 2026 15:59:58 +0100 Subject: [PATCH 18/21] [java-utils-maven3-ext] incremented patch version --- java-utils-bom/pom.xml | 2 +- java-utils-maven3-ext/pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java-utils-bom/pom.xml b/java-utils-bom/pom.xml index d550736..e5046d6 100644 --- a/java-utils-bom/pom.xml +++ b/java-utils-bom/pom.xml @@ -91,7 +91,7 @@ 2.0.0 2.0.0 2.0.0 - 2.0.0 + 2.0.1 2.0.0 2.0.0 2.0.0 diff --git a/java-utils-maven3-ext/pom.xml b/java-utils-maven3-ext/pom.xml index 242df49..e32ce7f 100644 --- a/java-utils-maven3-ext/pom.xml +++ b/java-utils-maven3-ext/pom.xml @@ -27,7 +27,7 @@ utils-maven3-ext - 2.0.0 + 2.0.1 Java Maven3 Extension Utils https://github.com/RunedUniverse/utils @@ -80,7 +80,7 @@ 3.8.4 1.18.12 - 2.0.0 + 2.0.1 From 540b5579fed855976eb83053b2a57796ca835559 Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Fri, 20 Feb 2026 17:38:18 +0100 Subject: [PATCH 19/21] [java-utils-maven3-ext-api] incremented patch version --- java-utils-bom/pom.xml | 2 +- java-utils-maven3-ext-api/pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java-utils-bom/pom.xml b/java-utils-bom/pom.xml index e5046d6..81c4d27 100644 --- a/java-utils-bom/pom.xml +++ b/java-utils-bom/pom.xml @@ -90,7 +90,7 @@ 2.0.0 2.0.0 2.0.0 - 2.0.0 + 2.0.1 2.0.1 2.0.0 2.0.0 diff --git a/java-utils-maven3-ext-api/pom.xml b/java-utils-maven3-ext-api/pom.xml index d338ef5..3350f8a 100644 --- a/java-utils-maven3-ext-api/pom.xml +++ b/java-utils-maven3-ext-api/pom.xml @@ -27,7 +27,7 @@ utils-maven3-ext-api - 2.0.0 + 2.0.1 Java Maven3 Extension Utils [API] https://github.com/RunedUniverse/utils @@ -80,7 +80,7 @@ 3.8.4 1.18.12 - 2.0.0 + 2.0.1 From f666254e84250b33f8c16f55d4aff89c68d93839 Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Sat, 21 Feb 2026 03:42:25 +0100 Subject: [PATCH 20/21] [java-utils-maven3-ext(-api)] added ExtensionType & added eclipse ClassLoader workaround --- .../utils/maven3/ext/api/ExtensionIndex.java | 13 ++++-- .../utils/maven3/ext/data/api/Extension.java | 6 +++ .../maven3/ext/data/api/ExtensionType.java | 20 +++++++++ .../maven3/ext/DefaultExtensionIndex.java | 43 +++++++++++++++---- .../lib/utils/maven3/ext/MvnCorePatcher.java | 27 ++++++++---- .../maven3/ext/data/DefaultExtension.java | 19 ++++++++ 6 files changed, 109 insertions(+), 19 deletions(-) create mode 100644 java-utils-maven3-ext-api/src/main/java/net/runeduniverse/lib/utils/maven3/ext/data/api/ExtensionType.java diff --git a/java-utils-maven3-ext-api/src/main/java/net/runeduniverse/lib/utils/maven3/ext/api/ExtensionIndex.java b/java-utils-maven3-ext-api/src/main/java/net/runeduniverse/lib/utils/maven3/ext/api/ExtensionIndex.java index 8d213a2..d8fbb5a 100644 --- a/java-utils-maven3-ext-api/src/main/java/net/runeduniverse/lib/utils/maven3/ext/api/ExtensionIndex.java +++ b/java-utils-maven3-ext-api/src/main/java/net/runeduniverse/lib/utils/maven3/ext/api/ExtensionIndex.java @@ -20,6 +20,7 @@ import org.apache.maven.model.Plugin; import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.classworlds.ClassWorld; import org.codehaus.plexus.classworlds.realm.ClassRealm; import org.eclipse.aether.RepositorySystemSession; @@ -27,13 +28,17 @@ public interface ExtensionIndex { + public static final String REALM_ID_MAVEN_EXT = "maven.ext"; + + public ClassWorld getClassWorld(); + public void discoverExtensions(); - public boolean discoverExtRealm(final ClassRealm realm); + public boolean discoverExtRealm(ClassRealm realm); - public void seedExtensions(final MavenProject mvnProject); + public void seedExtensions(MavenProject mvnProject); - public void discoverPlugins(final RepositorySystemSession repoSysSession, final MavenProject mvnProject); + public void discoverPlugins(RepositorySystemSession repoSysSession, MavenProject mvnProject); public Set getCoreExtensions(); @@ -43,4 +48,6 @@ public interface ExtensionIndex { public Map> getInvalidPlugins(); + public Set findExtensions(String groupId, String artifactId); + } diff --git a/java-utils-maven3-ext-api/src/main/java/net/runeduniverse/lib/utils/maven3/ext/data/api/Extension.java b/java-utils-maven3-ext-api/src/main/java/net/runeduniverse/lib/utils/maven3/ext/data/api/Extension.java index 3fb610f..d8c2abc 100644 --- a/java-utils-maven3-ext-api/src/main/java/net/runeduniverse/lib/utils/maven3/ext/data/api/Extension.java +++ b/java-utils-maven3-ext-api/src/main/java/net/runeduniverse/lib/utils/maven3/ext/data/api/Extension.java @@ -28,10 +28,16 @@ public interface Extension { + public static final String REALM_ID_PLEXUS_CORE = "plexus.core"; + public static final String REALM_ID_CORE_EXT_PREFIX = "coreExtension>"; + public static final String REALM_ID_BUILD_EXT_PREFIX = "extension>"; + public ClassRealm getClassRealm(); public CodeSource getCodeSource(); + public ExtensionType getType(); + public String getGroupId(); public String getArtifactId(); diff --git a/java-utils-maven3-ext-api/src/main/java/net/runeduniverse/lib/utils/maven3/ext/data/api/ExtensionType.java b/java-utils-maven3-ext-api/src/main/java/net/runeduniverse/lib/utils/maven3/ext/data/api/ExtensionType.java new file mode 100644 index 0000000..bc398e2 --- /dev/null +++ b/java-utils-maven3-ext-api/src/main/java/net/runeduniverse/lib/utils/maven3/ext/data/api/ExtensionType.java @@ -0,0 +1,20 @@ +/* + * Copyright © 2026 VenaNocta (venanocta@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package net.runeduniverse.lib.utils.maven3.ext.data.api; + +public enum ExtensionType { + PLEXUS, CORE, BUILD, UNKNOWN +} diff --git a/java-utils-maven3-ext/src/main/java/net/runeduniverse/lib/utils/maven3/ext/DefaultExtensionIndex.java b/java-utils-maven3-ext/src/main/java/net/runeduniverse/lib/utils/maven3/ext/DefaultExtensionIndex.java index 6ba5ac2..4d74b03 100644 --- a/java-utils-maven3-ext/src/main/java/net/runeduniverse/lib/utils/maven3/ext/DefaultExtensionIndex.java +++ b/java-utils-maven3-ext/src/main/java/net/runeduniverse/lib/utils/maven3/ext/DefaultExtensionIndex.java @@ -50,14 +50,13 @@ import static net.runeduniverse.lib.utils.common.CollectionUtils.copy; import static net.runeduniverse.lib.utils.common.CollectionUtils.unmodifiable; +import static net.runeduniverse.lib.utils.maven3.ext.data.api.Extension.REALM_ID_PLEXUS_CORE; +import static net.runeduniverse.lib.utils.maven3.ext.data.api.Extension.REALM_ID_CORE_EXT_PREFIX; +import static net.runeduniverse.lib.utils.maven3.ext.data.api.Extension.REALM_ID_BUILD_EXT_PREFIX; @Component(role = ExtensionIndex.class) public class DefaultExtensionIndex implements ExtensionIndex { - public static final String REALM_ID_PLEXUS_CORE = "plexus.core"; - public static final String REALM_ID_MAVEN_EXT = "maven.ext"; - public static final String REALM_ID_CORE_EXT_PREFIX = "coreExtension>"; - public static final String REALM_ID_BUILD_EXT_PREFIX = "extension>"; public static final String POM_PROP_FILE = "/META-INF/maven/*/*/pom.properties"; // supplier @@ -106,11 +105,16 @@ public DefaultExtensionIndex(final Supplier>> e this.invalidPlugins = new ConcurrentHashMap<>(); } + @Override + public ClassWorld getClassWorld() { + return this.container.getContainerRealm() + .getWorld(); + } + @Override public void discoverExtensions() { - final ClassRealm currentRealm = (ClassRealm) Thread.currentThread() - .getContextClassLoader(); - final ClassWorld world = currentRealm.getWorld(); + final ClassWorld world = this.container.getContainerRealm() + .getWorld(); ClassRealm searchRealm = world.getClassRealm(REALM_ID_MAVEN_EXT); if (searchRealm == null) @@ -226,7 +230,6 @@ protected Set fromExtRealm(final ClassRealm realm) { } else return set; - ext.setClassRealm(realm); set.add(ext); if (!ext.validate()) { @@ -330,10 +333,12 @@ protected void discoverPlugins(final RepositorySystemSession session, final Mave return; } + @Override public Set getCoreExtensions() { return unmodifiable(this.coreExtensions); } + @Override public Map> getExtensions() { final Map> map = this.extMapSupplier.get(); for (Entry> entry : this.extensionMap.entrySet()) { @@ -342,6 +347,7 @@ public Map> getExtensions() { return unmodifiable(map); } + @Override public Map> getExtPlugins() { final Map> map = this.pluginMapSupplier.get(); for (Entry> entry : this.extPlugins.entrySet()) { @@ -350,6 +356,7 @@ public Map> getExtPlugins() { return unmodifiable(map); } + @Override public Map> getInvalidPlugins() { final Map> map = this.pluginMapSupplier.get(); for (Entry> entry : this.invalidPlugins.entrySet()) { @@ -357,4 +364,24 @@ public Map> getInvalidPlugins() { } return unmodifiable(map); } + + @Override + public Set findExtensions(String groupId, String artifactId) { + final Set result = this.extSetSupplier.get(); + final boolean groupFilter = groupId != null; + final boolean artifactFilter = artifactId != null; + for (Entry> entry : this.realmMap.entrySet()) { + final Set set = entry.getValue(); + if (set == null) + continue; + for (Extension ext : set) { + if (groupFilter && !groupId.equals(ext.getGroupId())) + continue; + if (artifactFilter && !artifactId.equals(ext.getArtifactId())) + continue; + result.add(ext); + } + } + return result; + } } diff --git a/java-utils-maven3-ext/src/main/java/net/runeduniverse/lib/utils/maven3/ext/MvnCorePatcher.java b/java-utils-maven3-ext/src/main/java/net/runeduniverse/lib/utils/maven3/ext/MvnCorePatcher.java index f074420..bc6ad64 100644 --- a/java-utils-maven3-ext/src/main/java/net/runeduniverse/lib/utils/maven3/ext/MvnCorePatcher.java +++ b/java-utils-maven3-ext/src/main/java/net/runeduniverse/lib/utils/maven3/ext/MvnCorePatcher.java @@ -37,16 +37,14 @@ import net.runeduniverse.lib.utils.maven3.ext.data.api.ExtensionData; import net.runeduniverse.lib.utils.maven3.ext.data.api.PluginData; +import static net.runeduniverse.lib.utils.maven3.ext.data.api.Extension.REALM_ID_PLEXUS_CORE; +import static net.runeduniverse.lib.utils.maven3.ext.api.ExtensionIndex.REALM_ID_MAVEN_EXT; + public class MvnCorePatcher { public static final String ERR_FAILED_TO_LOAD_MAVEN_EXTENSION_CLASSREALM = // "Failed to load maven-extension ClassRealm"; - public static final String REALM_ID_PLEXUS_CORE = "plexus.core"; - public static final String REALM_ID_MAVEN_EXT = "maven.ext"; - public static final String REALM_ID_CORE_EXT_PREFIX = "coreExtension>"; - public static final String REALM_ID_BUILD_EXT_PREFIX = "extension>"; - protected final ExtensionIndex extensionIndex; protected boolean coreExtension = false; @@ -118,9 +116,22 @@ public boolean patchMaven(final MavenSession mvnSession, final Patch patch) thro callInfo_PatchingStarted(); - final ClassRealm currentRealm = (ClassRealm) Thread.currentThread() + final ClassWorld world = this.extensionIndex.getClassWorld(); + + final ClassLoader currentClassLoader = Thread.currentThread() .getContextClassLoader(); - final ClassWorld world = currentRealm.getWorld(); + final ClassRealm currentRealm; + + if (currentClassLoader instanceof ClassRealm) { + currentRealm = (ClassRealm) currentClassLoader; + } else { + // ---- this case only happens with m2e ---- + // because of that I can not infere how the extension is loaded + // => so I expect that only core-extensions are bootstrapped from outside the + // maven architecture! + this.coreExtension = true; + currentRealm = world.getClassRealm(REALM_ID_MAVEN_EXT); + } // extLoadState= 2 -> system core ext | 1 -> core ext | 0 -> build ext final short extLoadState; @@ -180,7 +191,7 @@ public boolean patchMaven(final MavenSession mvnSession, final Patch patch) thro } finally { callInfo_ResetRealm(); Thread.currentThread() - .setContextClassLoader(currentRealm); + .setContextClassLoader(currentClassLoader); } final Map> invalidPlugins = this.extensionIndex.getInvalidPlugins(); diff --git a/java-utils-maven3-ext/src/main/java/net/runeduniverse/lib/utils/maven3/ext/data/DefaultExtension.java b/java-utils-maven3-ext/src/main/java/net/runeduniverse/lib/utils/maven3/ext/data/DefaultExtension.java index 0fbf79d..349ec88 100644 --- a/java-utils-maven3-ext/src/main/java/net/runeduniverse/lib/utils/maven3/ext/data/DefaultExtension.java +++ b/java-utils-maven3-ext/src/main/java/net/runeduniverse/lib/utils/maven3/ext/data/DefaultExtension.java @@ -31,11 +31,13 @@ import net.runeduniverse.lib.utils.common.StringUtils; import net.runeduniverse.lib.utils.maven3.ext.data.api.Extension; +import net.runeduniverse.lib.utils.maven3.ext.data.api.ExtensionType; public class DefaultExtension implements Extension { protected ClassRealm realm = null; protected CodeSource source = null; + protected ExtensionType type = ExtensionType.UNKNOWN; protected String groupId = null; protected String artifactId = null; protected String version = null; @@ -54,6 +56,11 @@ public CodeSource getCodeSource() { return this.source; } + @Override + public ExtensionType getType() { + return this.type; + } + @Override public String getGroupId() { return this.groupId; @@ -91,6 +98,18 @@ public PluginDescriptor getPluginDescriptor(final MavenProject mvnProject) { @Override public void setClassRealm(final ClassRealm realm) { this.realm = realm; + + final String realmId = realm.getId(); + if (realmId == null) + this.type = ExtensionType.UNKNOWN; + else if (REALM_ID_PLEXUS_CORE.equals(realmId)) + this.type = ExtensionType.PLEXUS; + else if (realmId.startsWith(REALM_ID_CORE_EXT_PREFIX)) + this.type = ExtensionType.CORE; + else if (realmId.startsWith(REALM_ID_BUILD_EXT_PREFIX)) + this.type = ExtensionType.BUILD; + else + this.type = ExtensionType.UNKNOWN; } @Override From 49e7a7a49cd822052c856c901a092c95ef95b756 Mon Sep 17 00:00:00 2001 From: VenaNocta Date: Sat, 21 Feb 2026 16:40:30 +0100 Subject: [PATCH 21/21] [java-utils-maven3-ext] improved m2e compatibility (fixes #20) --- .../lib/utils/maven3/ext/MvnCorePatcher.java | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/java-utils-maven3-ext/src/main/java/net/runeduniverse/lib/utils/maven3/ext/MvnCorePatcher.java b/java-utils-maven3-ext/src/main/java/net/runeduniverse/lib/utils/maven3/ext/MvnCorePatcher.java index bc6ad64..a712e77 100644 --- a/java-utils-maven3-ext/src/main/java/net/runeduniverse/lib/utils/maven3/ext/MvnCorePatcher.java +++ b/java-utils-maven3-ext/src/main/java/net/runeduniverse/lib/utils/maven3/ext/MvnCorePatcher.java @@ -16,6 +16,7 @@ package net.runeduniverse.lib.utils.maven3.ext; import java.util.Collection; +import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Objects; @@ -49,6 +50,7 @@ public class MvnCorePatcher { protected boolean coreExtension = false; protected boolean supportBuildExtension = false; + protected boolean m2eDetected = false; // supplier protected ClassRealmFactory extensionRealmFactory = null; // events @@ -117,6 +119,7 @@ public boolean patchMaven(final MavenSession mvnSession, final Patch patch) thro callInfo_PatchingStarted(); final ClassWorld world = this.extensionIndex.getClassWorld(); + final String realmIdMavenExt; final ClassLoader currentClassLoader = Thread.currentThread() .getContextClassLoader(); @@ -124,13 +127,29 @@ public boolean patchMaven(final MavenSession mvnSession, final Patch patch) thro if (currentClassLoader instanceof ClassRealm) { currentRealm = (ClassRealm) currentClassLoader; + realmIdMavenExt = REALM_ID_MAVEN_EXT; } else { // ---- this case only happens with m2e ---- // because of that I can not infere how the extension is loaded // => so I expect that only core-extensions are bootstrapped from outside the // maven architecture! + if ("org.eclipse.osgi.internal.framework.ContextFinder".equals(currentClassLoader.getClass() + .getCanonicalName())) { + // yep - really sure it's m2e + this.m2eDetected = true; + // note: for some weird reason m2e creates the extension realm + // with id="maven.ext." + realmIdMavenExt = "maven.ext."; + } else { + realmIdMavenExt = REALM_ID_MAVEN_EXT; + } + this.coreExtension = true; - currentRealm = world.getClassRealm(REALM_ID_MAVEN_EXT); + // try to find the ClassRealm that contains the extensions + ClassRealm searchRealm = world.getClassRealm(realmIdMavenExt); + if (searchRealm == null) + searchRealm = world.getClassRealm(REALM_ID_PLEXUS_CORE); + currentRealm = searchRealm; } // extLoadState= 2 -> system core ext | 1 -> core ext | 0 -> build ext @@ -146,7 +165,7 @@ public boolean patchMaven(final MavenSession mvnSession, final Patch patch) thro extLoadState = 2; } else if (this.coreExtension) { callInfo_SwitchRealmToMavenExt(); - realm = world.getRealm(REALM_ID_MAVEN_EXT); + realm = world.getRealm(realmIdMavenExt); extLoadState = 1; } else if (this.supportBuildExtension) { realm = createExtensionRealm(plexusCore, currentRealm); @@ -166,9 +185,13 @@ public boolean patchMaven(final MavenSession mvnSession, final Patch patch) thro this.extensionIndex.discoverExtensions(); - for (MavenProject mvnProject : mvnSession.getAllProjects()) { - this.extensionIndex.seedExtensions(mvnProject); - this.extensionIndex.discoverPlugins(mvnSession.getRepositorySession(), mvnProject); + final List allProjects = mvnSession.getAllProjects(); + if (allProjects != null) { + // in maven3 this is never null, except when m2e is in play! + for (MavenProject mvnProject : mvnSession.getAllProjects()) { + this.extensionIndex.seedExtensions(mvnProject); + this.extensionIndex.discoverPlugins(mvnSession.getRepositorySession(), mvnProject); + } } final Map> extensions = this.extensionIndex.getExtensions();