From f7e6f6f0d17fdc996dee6c1f297987e6df19d67e Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Fri, 14 Mar 2025 22:11:20 +0100 Subject: [PATCH 01/10] [IT] Related fixes --- .../maven/cling/executor/ExecutorHelper.java | 2 +- .../cling/executor/internal/HelperImpl.java | 26 ------------------- .../cling/executor/internal/ToolboxTool.java | 25 +++++++++++++----- ...lperImplTest.java => ToolboxToolTest.java} | 21 ++++++++------- .../java/org/apache/maven/it/Verifier.java | 21 +++++++++------ its/pom.xml | 4 +-- 6 files changed, 47 insertions(+), 52 deletions(-) rename impl/maven-executor/src/test/java/org/apache/maven/cling/executor/impl/{HelperImplTest.java => ToolboxToolTest.java} (88%) diff --git a/impl/maven-executor/src/main/java/org/apache/maven/cling/executor/ExecutorHelper.java b/impl/maven-executor/src/main/java/org/apache/maven/cling/executor/ExecutorHelper.java index 14a5e2abd2d4..c6dc27feb0ae 100644 --- a/impl/maven-executor/src/main/java/org/apache/maven/cling/executor/ExecutorHelper.java +++ b/impl/maven-executor/src/main/java/org/apache/maven/cling/executor/ExecutorHelper.java @@ -26,7 +26,7 @@ /** * Helper class for routing Maven execution based on preferences and/or issued execution requests. */ -public interface ExecutorHelper extends ExecutorTool { +public interface ExecutorHelper { /** * The modes of execution. */ diff --git a/impl/maven-executor/src/main/java/org/apache/maven/cling/executor/internal/HelperImpl.java b/impl/maven-executor/src/main/java/org/apache/maven/cling/executor/internal/HelperImpl.java index 4304f6d87195..9a94ddc2ddfd 100644 --- a/impl/maven-executor/src/main/java/org/apache/maven/cling/executor/internal/HelperImpl.java +++ b/impl/maven-executor/src/main/java/org/apache/maven/cling/executor/internal/HelperImpl.java @@ -21,7 +21,6 @@ import java.nio.file.Path; import java.util.Collections; import java.util.HashMap; -import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.apache.maven.api.annotations.Nullable; @@ -29,7 +28,6 @@ import org.apache.maven.api.cli.ExecutorException; import org.apache.maven.api.cli.ExecutorRequest; import org.apache.maven.cling.executor.ExecutorHelper; -import org.apache.maven.cling.executor.ExecutorTool; import static java.util.Objects.requireNonNull; @@ -40,7 +38,6 @@ public class HelperImpl implements ExecutorHelper { private final Mode defaultMode; private final Path installationDirectory; private final Path userHomeDirectory; - private final ExecutorTool executorTool; private final HashMap executors; private final ConcurrentHashMap cache; @@ -58,7 +55,6 @@ public HelperImpl( this.userHomeDirectory = userHomeDirectory != null ? ExecutorRequest.getCanonicalPath(userHomeDirectory) : ExecutorRequest.discoverUserHomeDirectory(); - this.executorTool = new ToolboxTool(this); this.executors = new HashMap<>(); this.executors.put(Mode.EMBEDDED, requireNonNull(embedded, "embedded")); @@ -89,28 +85,6 @@ public String mavenVersion() { }); } - @Override - public Map dump(ExecutorRequest.Builder request) throws ExecutorException { - return executorTool.dump(request); - } - - @Override - public String localRepository(ExecutorRequest.Builder request) throws ExecutorException { - return executorTool.localRepository(request); - } - - @Override - public String artifactPath(ExecutorRequest.Builder request, String gav, String repositoryId) - throws ExecutorException { - return executorTool.artifactPath(request, gav, repositoryId); - } - - @Override - public String metadataPath(ExecutorRequest.Builder request, String gav, String repositoryId) - throws ExecutorException { - return executorTool.metadataPath(request, gav, repositoryId); - } - protected Executor getExecutor(Mode mode, ExecutorRequest request) throws ExecutorException { return switch (mode) { case AUTO -> getExecutorByRequest(request); diff --git a/impl/maven-executor/src/main/java/org/apache/maven/cling/executor/internal/ToolboxTool.java b/impl/maven-executor/src/main/java/org/apache/maven/cling/executor/internal/ToolboxTool.java index b23a4948a3ea..6a39b26475f2 100644 --- a/impl/maven-executor/src/main/java/org/apache/maven/cling/executor/internal/ToolboxTool.java +++ b/impl/maven-executor/src/main/java/org/apache/maven/cling/executor/internal/ToolboxTool.java @@ -59,7 +59,8 @@ public Map dump(ExecutorRequest.Builder executorRequest) throws doExecute(builder); try { Properties properties = new Properties(); - properties.load(new ByteArrayInputStream(stdout.toByteArray())); + properties.load( + new ByteArrayInputStream(validateOutput(false, stdout, stderr).getBytes())); return properties.entrySet().stream() .collect(Collectors.toMap( e -> String.valueOf(e.getKey()), @@ -79,7 +80,7 @@ public String localRepository(ExecutorRequest.Builder executorRequest) throws Ex .stdOut(stdout) .stdErr(stderr); doExecute(builder); - return shaveStdout(stdout); + return validateOutput(true, stdout, stderr); } @Override @@ -95,7 +96,7 @@ public String artifactPath(ExecutorRequest.Builder executorRequest, String gav, builder.argument("-Drepository=" + repositoryId + "::unimportant"); } doExecute(builder); - return shaveStdout(stdout); + return validateOutput(true, stdout, stderr); } @Override @@ -111,7 +112,7 @@ public String metadataPath(ExecutorRequest.Builder executorRequest, String gav, builder.argument("-Drepository=" + repositoryId + "::unimportant"); } doExecute(builder); - return shaveStdout(stdout); + return validateOutput(true, stdout, stderr); } private ExecutorRequest.Builder mojo(ExecutorRequest.Builder builder, String mojo) { @@ -131,7 +132,19 @@ private void doExecute(ExecutorRequest.Builder builder) { } } - private String shaveStdout(ByteArrayOutputStream stdout) { - return stdout.toString().replace("\n", "").replace("\r", ""); + /** + * Performs "sanity check" for output, making sure no insane values like empty strings are returned. + */ + private String validateOutput(boolean shave, ByteArrayOutputStream stdout, ByteArrayOutputStream stderr) { + String result = stdout.toString(); + if (shave) { + result = result.replace("\n", "").replace("\r", ""); + } + // sanity checks: stderr has any OR result is empty string (no method should emit empty string) + if (stderr.size() > 0 || result.trim().isEmpty()) { + throw new ExecutorException( + "Unexpected stdout[" + stdout.size() + "]=" + stdout + "; stderr[" + stderr.size() + "]=" + stderr); + } + return result; } } diff --git a/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/impl/HelperImplTest.java b/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/impl/ToolboxToolTest.java similarity index 88% rename from impl/maven-executor/src/test/java/org/apache/maven/cling/executor/impl/HelperImplTest.java rename to impl/maven-executor/src/test/java/org/apache/maven/cling/executor/impl/ToolboxToolTest.java index ee4c70bd204d..d34fc00f0801 100644 --- a/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/impl/HelperImplTest.java +++ b/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/impl/ToolboxToolTest.java @@ -27,6 +27,7 @@ import org.apache.maven.cling.executor.ExecutorHelper; import org.apache.maven.cling.executor.MavenExecutorTestSupport; import org.apache.maven.cling.executor.internal.HelperImpl; +import org.apache.maven.cling.executor.internal.ToolboxTool; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; @@ -38,7 +39,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -public class HelperImplTest { +public class ToolboxToolTest { @TempDir private static Path userHome; @@ -52,7 +53,7 @@ void dump3(ExecutorHelper.Mode mode) throws Exception { userHome, MavenExecutorTestSupport.EMBEDDED_MAVEN_EXECUTOR, MavenExecutorTestSupport.FORKED_MAVEN_EXECUTOR); - Map dump = helper.dump(helper.executorRequest()); + Map dump = new ToolboxTool(helper).dump(helper.executorRequest()); assertEquals(System.getProperty("maven3version"), dump.get("maven.version")); } @@ -66,7 +67,7 @@ void dump4(ExecutorHelper.Mode mode) throws Exception { userHome, MavenExecutorTestSupport.EMBEDDED_MAVEN_EXECUTOR, MavenExecutorTestSupport.FORKED_MAVEN_EXECUTOR); - Map dump = helper.dump(helper.executorRequest()); + Map dump = new ToolboxTool(helper).dump(helper.executorRequest()); assertEquals(System.getProperty("maven4version"), dump.get("maven.version")); } @@ -106,7 +107,7 @@ void localRepository3(ExecutorHelper.Mode mode) { userHome, MavenExecutorTestSupport.EMBEDDED_MAVEN_EXECUTOR, MavenExecutorTestSupport.FORKED_MAVEN_EXECUTOR); - String localRepository = helper.localRepository(helper.executorRequest()); + String localRepository = new ToolboxTool(helper).localRepository(helper.executorRequest()); Path local = Paths.get(localRepository); assertTrue(Files.isDirectory(local)); } @@ -122,7 +123,7 @@ void localRepository4(ExecutorHelper.Mode mode) { userHome, MavenExecutorTestSupport.EMBEDDED_MAVEN_EXECUTOR, MavenExecutorTestSupport.FORKED_MAVEN_EXECUTOR); - String localRepository = helper.localRepository(helper.executorRequest()); + String localRepository = new ToolboxTool(helper).localRepository(helper.executorRequest()); Path local = Paths.get(localRepository); assertTrue(Files.isDirectory(local)); } @@ -137,7 +138,8 @@ void artifactPath3(ExecutorHelper.Mode mode) { userHome, MavenExecutorTestSupport.EMBEDDED_MAVEN_EXECUTOR, MavenExecutorTestSupport.FORKED_MAVEN_EXECUTOR); - String path = helper.artifactPath(helper.executorRequest(), "aopalliance:aopalliance:1.0", "central"); + String path = new ToolboxTool(helper) + .artifactPath(helper.executorRequest(), "aopalliance:aopalliance:1.0", "central"); // split repository: assert "ends with" as split may introduce prefixes assertTrue( path.endsWith("aopalliance" + File.separator + "aopalliance" + File.separator + "1.0" + File.separator @@ -155,7 +157,8 @@ void artifactPath4(ExecutorHelper.Mode mode) { userHome, MavenExecutorTestSupport.EMBEDDED_MAVEN_EXECUTOR, MavenExecutorTestSupport.FORKED_MAVEN_EXECUTOR); - String path = helper.artifactPath(helper.executorRequest(), "aopalliance:aopalliance:1.0", "central"); + String path = new ToolboxTool(helper) + .artifactPath(helper.executorRequest(), "aopalliance:aopalliance:1.0", "central"); // split repository: assert "ends with" as split may introduce prefixes assertTrue( path.endsWith("aopalliance" + File.separator + "aopalliance" + File.separator + "1.0" + File.separator @@ -173,7 +176,7 @@ void metadataPath3(ExecutorHelper.Mode mode) { userHome, MavenExecutorTestSupport.EMBEDDED_MAVEN_EXECUTOR, MavenExecutorTestSupport.FORKED_MAVEN_EXECUTOR); - String path = helper.metadataPath(helper.executorRequest(), "aopalliance", "someremote"); + String path = new ToolboxTool(helper).metadataPath(helper.executorRequest(), "aopalliance", "someremote"); // split repository: assert "ends with" as split may introduce prefixes assertTrue(path.endsWith("aopalliance" + File.separator + "maven-metadata-someremote.xml"), "path=" + path); } @@ -188,7 +191,7 @@ void metadataPath4(ExecutorHelper.Mode mode) { userHome, MavenExecutorTestSupport.EMBEDDED_MAVEN_EXECUTOR, MavenExecutorTestSupport.FORKED_MAVEN_EXECUTOR); - String path = helper.metadataPath(helper.executorRequest(), "aopalliance", "someremote"); + String path = new ToolboxTool(helper).metadataPath(helper.executorRequest(), "aopalliance", "someremote"); // split repository: assert "ends with" as split may introduce prefixes assertTrue(path.endsWith("aopalliance" + File.separator + "maven-metadata-someremote.xml"), "path=" + path); } diff --git a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java index 7ec9acdaaba6..848b829fa822 100644 --- a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java +++ b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java @@ -48,9 +48,11 @@ import org.apache.maven.api.cli.ExecutorException; import org.apache.maven.api.cli.ExecutorRequest; import org.apache.maven.cling.executor.ExecutorHelper; +import org.apache.maven.cling.executor.ExecutorTool; import org.apache.maven.cling.executor.embedded.EmbeddedMavenExecutor; import org.apache.maven.cling.executor.forked.ForkedMavenExecutor; import org.apache.maven.cling.executor.internal.HelperImpl; +import org.apache.maven.cling.executor.internal.ToolboxTool; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; @@ -88,6 +90,8 @@ public class Verifier { private final ExecutorHelper executorHelper; + private final ExecutorTool executorTool; + private final Path basedir; // the basedir of IT private final Path tempBasedir; // empty basedir for queries @@ -143,6 +147,7 @@ public Verifier(String basedir, List defaultCliArguments) throws Verific this.userHomeDirectory, EMBEDDED_MAVEN_EXECUTOR, FORKED_MAVEN_EXECUTOR); + this.executorTool = new ToolboxTool(executorHelper); this.defaultCliArguments = new ArrayList<>(defaultCliArguments != null ? defaultCliArguments : DEFAULT_CLI_ARGUMENTS); this.logFile = this.basedir.resolve(logFileName); @@ -232,7 +237,7 @@ public void execute() throws VerificationException { if (ret > 0) { String dump; try { - dump = executorHelper.dump(request.toBuilder()).toString(); + dump = executorTool.dump(request.toBuilder()).toString(); } catch (Exception e) { dump = "FAILED: " + e.getMessage(); } @@ -328,14 +333,14 @@ public String getLocalRepositoryWithSettings(String settingsXml) { if (!Files.isRegularFile(settingsFile)) { throw new IllegalArgumentException("settings xml does not exist: " + settingsXml); } - return executorHelper.localRepository(executorHelper + return executorTool.localRepository(executorHelper .executorRequest() .cwd(tempBasedir) .userHomeDirectory(userHomeDirectory) .argument("-s") .argument(settingsFile.toString())); } else { - return executorHelper.localRepository( + return executorTool.localRepository( executorHelper.executorRequest().cwd(tempBasedir).userHomeDirectory(userHomeDirectory)); } } @@ -632,7 +637,7 @@ public String getArtifactPath(String gid, String aid, String version, String ext } return getLocalRepository() + File.separator - + executorHelper.artifactPath(executorHelper.executorRequest(), gav, null); + + executorTool.artifactPath(executorHelper.executorRequest(), gav, null); } private String getSupportArtifactPath(String artifact) { @@ -689,7 +694,7 @@ public String getSupportArtifactPath(String gid, String aid, String version, Str gav = gid + ":" + aid + ":" + ext + ":" + version; } return outerLocalRepository - .resolve(executorHelper.artifactPath( + .resolve(executorTool.artifactPath( executorHelper.executorRequest().argument("-Dmaven.repo.local=" + outerLocalRepository), gav, null)) @@ -764,7 +769,7 @@ public String getArtifactMetadataPath(String gid, String aid, String version, St gav += filename; return getLocalRepository() + File.separator - + executorHelper.metadataPath(executorHelper.executorRequest(), gav, repoId); + + executorTool.metadataPath(executorHelper.executorRequest(), gav, repoId); } /** @@ -794,7 +799,7 @@ public void deleteArtifact(String org, String name, String version, String ext) * @since 1.2 */ public void deleteArtifacts(String gid) throws IOException { - String mdPath = executorHelper.metadataPath(executorHelper.executorRequest(), gid, null); + String mdPath = executorTool.metadataPath(executorHelper.executorRequest(), gid, null); Path dir = Paths.get(getLocalRepository()).resolve(mdPath).getParent(); FileUtils.deleteDirectory(dir.toFile()); } @@ -814,7 +819,7 @@ public void deleteArtifacts(String gid, String aid, String version) throws IOExc requireNonNull(version, "version is null"); String mdPath = - executorHelper.metadataPath(executorHelper.executorRequest(), gid + ":" + aid + ":" + version, null); + executorTool.metadataPath(executorHelper.executorRequest(), gid + ":" + aid + ":" + version, null); Path dir = Paths.get(getLocalRepository()).resolve(mdPath).getParent(); FileUtils.deleteDirectory(dir.toFile()); } diff --git a/its/pom.xml b/its/pom.xml index d287614b72c1..8a217784fd22 100644 --- a/its/pom.xml +++ b/its/pom.xml @@ -23,7 +23,7 @@ under the License. org.apache.maven maven - 4.0.0-rc-3-SNAPSHOT + 4.0.0-rc-4-SNAPSHOT org.apache.maven.its @@ -73,7 +73,7 @@ under the License. - 4.0.0-rc-3-SNAPSHOT + 4.0.0-rc-4-SNAPSHOT 3.15.1 From ebf7ecb96b5ea184c0afe7d0d9f5dd44c1c56099 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Fri, 14 Mar 2025 22:22:07 +0100 Subject: [PATCH 02/10] Reformat --- .../org/apache/maven/cling/executor/internal/ToolboxTool.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/impl/maven-executor/src/main/java/org/apache/maven/cling/executor/internal/ToolboxTool.java b/impl/maven-executor/src/main/java/org/apache/maven/cling/executor/internal/ToolboxTool.java index 6a39b26475f2..2c08093ce6d7 100644 --- a/impl/maven-executor/src/main/java/org/apache/maven/cling/executor/internal/ToolboxTool.java +++ b/impl/maven-executor/src/main/java/org/apache/maven/cling/executor/internal/ToolboxTool.java @@ -59,8 +59,8 @@ public Map dump(ExecutorRequest.Builder executorRequest) throws doExecute(builder); try { Properties properties = new Properties(); - properties.load( - new ByteArrayInputStream(validateOutput(false, stdout, stderr).getBytes())); + properties.load(new ByteArrayInputStream( + validateOutput(false, stdout, stderr).getBytes())); return properties.entrySet().stream() .collect(Collectors.toMap( e -> String.valueOf(e.getKey()), From ac37cc6acf53736d07885225ec88f0fc344e93da Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Sat, 15 Mar 2025 14:58:37 +0100 Subject: [PATCH 03/10] Fix IT settings central overrides Central should not need snapshots=true; and this makes Mimir refuse to handle it as well. --- .../src/test/resources-filtered/settings-remote.xml | 4 ++-- its/core-it-suite/src/test/resources-filtered/settings.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/its/core-it-suite/src/test/resources-filtered/settings-remote.xml b/its/core-it-suite/src/test/resources-filtered/settings-remote.xml index d0d696e1f37f..7f714f84b59f 100644 --- a/its/core-it-suite/src/test/resources-filtered/settings-remote.xml +++ b/its/core-it-suite/src/test/resources-filtered/settings-remote.xml @@ -49,7 +49,7 @@ plugins/artifacts from test repos so use of these settings should be the excepti true - true + false @@ -62,7 +62,7 @@ plugins/artifacts from test repos so use of these settings should be the excepti true - true + false diff --git a/its/core-it-suite/src/test/resources-filtered/settings.xml b/its/core-it-suite/src/test/resources-filtered/settings.xml index 4a456c25076e..809f16331c10 100644 --- a/its/core-it-suite/src/test/resources-filtered/settings.xml +++ b/its/core-it-suite/src/test/resources-filtered/settings.xml @@ -51,7 +51,7 @@ own test repos or can employ the local repository (after bootstrapping). This co true - true + false From 84b83274a03e75582af9b8e94ec10b1f36df8dd3 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Sat, 15 Mar 2025 15:52:21 +0100 Subject: [PATCH 04/10] Fix badle setup MNG-5175 IT --- .../resources/mng-5175/settings-template.xml | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/its/core-it-suite/src/test/resources/mng-5175/settings-template.xml b/its/core-it-suite/src/test/resources/mng-5175/settings-template.xml index c6fc8614c87d..2dfd86fa3f75 100644 --- a/its/core-it-suite/src/test/resources/mng-5175/settings-template.xml +++ b/its/core-it-suite/src/test/resources/mng-5175/settings-template.xml @@ -20,5 +20,46 @@ http://localhost:@port@/archiva/repository/internal/ + + + + maven-core-it-repo + + + maven-core-it + http://unimportant + + true + ignore + + + true + ignore + + + + + + maven-core-it + http://localhost:@port@/repo + + true + ignore + + + true + ignore + + + + + + + maven-core-it-repo + From c7f9a61a2f56626109ccc5b27ea3b4ca62bff4fb Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Sat, 15 Mar 2025 16:36:28 +0100 Subject: [PATCH 05/10] Fix IT: with change the repo order got back to normal and 1st repo is reported, that is now central. Leaving test as is (fragile) as order change is detected ths way. --- .../it/MavenITmng3477DependencyResolutionErrorMessageTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3477DependencyResolutionErrorMessageTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3477DependencyResolutionErrorMessageTest.java index 8cf4ebbd6f89..5adfe1075f2f 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3477DependencyResolutionErrorMessageTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3477DependencyResolutionErrorMessageTest.java @@ -96,7 +96,7 @@ void connectionProblemsPlugin() throws Exception { new String[] { ".*The following artifacts could not be resolved: org.apache.maven.its.plugins:maven-it-plugin-not-exists:pom:1.2.3 \\(absent\\): " + "Could not transfer artifact org.apache.maven.its.plugins:maven-it-plugin-not-exists:pom:1.2.3 from/to " - + "maven-core-it \\(http://localhost:.*/repo\\): Connection to http://localhost:.*2/repo/ refused.*" + + "central \\(http://localhost:.*/repo\\): Connection to http://localhost:.*2/repo/ refused.*" }, "pom-plugin.xml"); } From 4e2b82ef77f28cb5383bfb584dc3045b52708d12 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Sat, 15 Mar 2025 18:48:18 +1000 Subject: [PATCH 06/10] Restore Jenkins build for master (#2151) * Restore Jenkinsfile Signed-off-by: Olivier Lamy --- Jenkinsfile | 85 ++++++++ disabled-Jenkinsfile | 184 ------------------ disabled-Jenkinsfile.its | 58 ------ disabled-Jenkinsfile.s390x | 171 ---------------- .../it/AbstractMavenIntegrationTestCase.java | 12 ++ .../java/org/apache/maven/it/Verifier.java | 12 ++ pom.xml | 90 ++++++++- 7 files changed, 198 insertions(+), 414 deletions(-) create mode 100644 Jenkinsfile delete mode 100644 disabled-Jenkinsfile delete mode 100644 disabled-Jenkinsfile.its delete mode 100644 disabled-Jenkinsfile.s390x diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000000..87c141ea3c27 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,85 @@ +#!groovy + +pipeline { + agent none + // save some io during the build + options { + skipDefaultCheckout() + durabilityHint('PERFORMANCE_OPTIMIZED') + //buildDiscarder logRotator( numToKeepStr: '60' ) + disableRestartFromStage() + } + stages { + stage("Parallel Stage") { + parallel { + + stage("Build / Test - JDK17") { + agent { node { label 'ubuntu' } } + steps { + timeout(time: 210, unit: 'MINUTES') { + checkout scm + mavenBuild("jdk_17_latest", "-Djacoco.skip=true") + script { + properties([buildDiscarder(logRotator(artifactNumToKeepStr: '5', numToKeepStr: env.BRANCH_NAME == 'master' ? '30' : '5'))]) + if (env.BRANCH_NAME == 'master') { + withEnv(["JAVA_HOME=${tool "jdk_17_latest"}", + "PATH+MAVEN=${ tool "jdk_17_latest" }/bin:${tool "maven_3_latest"}/bin", + "MAVEN_OPTS=-Xms4G -Xmx4G -Djava.awt.headless=true"]) { + sh "mvn clean deploy -DdeployAtEnd=true -B" + } + } + } + } + } + } + + stage("Build / Test - JDK21") { + agent { node { label 'ubuntu' } } + steps { + timeout(time: 210, unit: 'MINUTES') { + checkout scm + // jacoco is definitely too slow + mavenBuild("jdk_21_latest", "") // "-Pjacoco jacoco-aggregator:report-aggregate-all" + // recordIssues id: "analysis-jdk17", name: "Static Analysis jdk17", aggregatingResults: true, enabledForFailure: true, + // tools: [mavenConsole(), java(), checkStyle(), errorProne(), spotBugs(), javaDoc()], + // skipPublishingChecks: true, skipBlames: true + // recordCoverage id: "coverage-jdk21", name: "Coverage jdk21", tools: [[parser: 'JACOCO',pattern: 'target/site/jacoco-aggregate/jacoco.xml']], + // sourceCodeRetention: 'MODIFIED', sourceDirectories: [[path: 'src/main/java']] + } + } + } + } + } + } +} + +/** + * To other developers, if you are using this method above, please use the following syntax. + * + * mavenBuild("", " " + * + * @param jdk the jdk tool name (in jenkins) to use for this build + * @param extraArgs extra command line args + */ +def mavenBuild(jdk, extraArgs) { + script { + try { + withEnv(["JAVA_HOME=${tool "$jdk"}", + "PATH+MAVEN=${ tool "$jdk" }/bin:${tool "maven_3_latest"}/bin", + "MAVEN_OPTS=-Xms4G -Xmx4G -Djava.awt.headless=true"]) { + sh "mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.3.2:wrapper -Dmaven=3.9.9" + sh "./mvnw clean install -B -U -e -DskipTests -PversionlessMavenDist -V -DdistributionTargetDir=${env.WORKSPACE}/.apache-maven-master" + // we use two steps so that we can cache artifacts downloaded from Maven Central repository + // without installing any local artifacts to not pollute the cache + sh "echo package Its" + sh "./mvnw package -DskipTests -e -B -V -Prun-its -Dmaven.repo.local=${env.WORKSPACE}/.repository/cached" + sh "echo run Its" + sh "./mvnw install -Pci $extraArgs -Dmaven.home=${env.WORKSPACE}/.apache-maven-master -e -B -V -Prun-its -Dmaven.repo.local=${env.WORKSPACE}/.repository/local -Dmaven.repo.local.tail=${env.WORKSPACE}/.repository/cached" + } + } + finally { + junit testResults: '**/target/test-results-surefire/*.xml', allowEmptyResults: true + } + } +} +// vim: et:ts=2:sw=2:ft=groovy diff --git a/disabled-Jenkinsfile b/disabled-Jenkinsfile deleted file mode 100644 index ffe7aa732151..000000000000 --- a/disabled-Jenkinsfile +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -properties([buildDiscarder(logRotator(artifactNumToKeepStr: '5', numToKeepStr: env.BRANCH_NAME=='master'?'5':'1'))]) - -def buildOs = 'linux' -def buildJdk = '17' -def buildMvn = '3.8.x' -def runITsOses = ['linux'] -def runITsJdks = ['17', '21'] -def runITsMvn = '3.8.x' -def runITscommand = "mvn clean install -Prun-its,embedded -B -U -V" // -DmavenDistro=... -Dmaven.test.failure.ignore=true -def tests - -try { - -def osNode = jenkinsEnv.labelForOS(buildOs) -node(jenkinsEnv.nodeSelection(osNode)) { - dir('build') { - stage('Checkout') { - checkout scm - } - - def WORK_DIR=pwd() - def MAVEN_GOAL='verify' - - stage('Configure deploy') { - if (env.BRANCH_NAME in ['master', 'maven-3.8.x', 'maven-3.9.x']){ - MAVEN_GOAL='deploy' - } - } - - stage('Build / Unit Test') { - String jdkName = jenkinsEnv.jdkFromVersion(buildOs, buildJdk) - String mvnName = jenkinsEnv.mvnFromVersion(buildOs, buildMvn) - try { - withEnv(["JAVA_HOME=${ tool "$jdkName" }", - "PATH+MAVEN=${ tool "$jdkName" }/bin:${tool "$mvnName"}/bin", - "MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) { - sh "mvn clean ${MAVEN_GOAL} -B -U -e -fae -V -Dmaven.test.failure.ignore -PversionlessMavenDist -Dmaven.repo.local=${WORK_DIR}/.repository" - } - } finally { - junit testResults: '**/target/surefire-reports/*.xml,**/target/failsafe-reports/*.xml', allowEmptyResults: true - } - } - } -} - -Map runITsTasks = [:] -for (String os in runITsOses) { - for (def jdk in runITsJdks) { - String osLabel = jenkinsEnv.labelForOS(os); - String jdkName = jenkinsEnv.jdkFromVersion(os, "${jdk}") - String mvnName = jenkinsEnv.mvnFromVersion(os, "${runITsMvn}") - echo "OS: ${os} JDK: ${jdk} => Label: ${osLabel} JDK: ${jdkName}" - - String stageId = "${os}-jdk${jdk}" - String stageLabel = "Run ITs ${os.capitalize()} Java ${jdk}" - runITsTasks[stageId] = { - node(jenkinsEnv.nodeSelection(osLabel)) { - stage("${stageLabel}") { - echo "NODE_NAME = ${env.NODE_NAME}" - // on Windows, need a short path or we hit 256 character limit for paths - // using EXECUTOR_NUMBER guarantees that concurrent builds on same agent - // will not trample each other plus workaround for JENKINS-52657 - dir(isUnix() ? 'test' : "c:\\mvn-it-${EXECUTOR_NUMBER}.tmp") { - def WORK_DIR=pwd() - try { - dir ('maven') { - checkout scm - withEnv(["JAVA_HOME=${ tool "$jdkName" }", - "PATH+MAVEN=${ tool "$jdkName" }/bin:${tool "$mvnName"}/bin", - "MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) { - sh "mvn clean install -B -U -e -DskipTests -V -PversionlessMavenDist -Dmaven.repo.local=${WORK_DIR}/.repository" - } - } - dir ('its') { - def ITS_BRANCH = env.CHANGE_BRANCH != null ? env.CHANGE_BRANCH : env.BRANCH_NAME; - try { - echo "Checkout ITs from branch: ${ITS_BRANCH}" - checkout([$class: 'GitSCM', - branches: [[name: ITS_BRANCH]], - extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]], - userRemoteConfigs: [[url: 'https://github.com/apache/maven-integration-testing.git']]]) - } catch (Throwable e) { - echo "Failure checkout ITs branch: ${ITS_BRANCH} - fallback master branch" - checkout([$class: 'GitSCM', - branches: [[name: "*/master"]], - extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]], - userRemoteConfigs: [[url: 'https://github.com/apache/maven-integration-testing.git']]]) - } - - try { - withEnv(["JAVA_HOME=${ tool "$jdkName" }", - "PATH+MAVEN=${ tool "$jdkName" }/bin:${tool "$mvnName"}/bin", - "MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) { - String cmd = "${runITscommand} -Dmaven.repo.local=$WORK_DIR/.repository -DmavenDistro=$WORK_DIR/maven/apache-maven/target/apache-maven-bin.zip -Dmaven.test.failure.ignore" - - if (isUnix()) { - sh 'df -hT' - sh "${cmd}" - } else { - bat 'wmic logicaldisk get size,freespace,caption' - bat "${cmd}" - } - } - } finally { - // in ITs test we need only reports from test itself - // test projects can contain reports with tested failed builds - junit testResults: '**/core-it-suite/target/surefire-reports/*.xml,**/core-it-support/**/target/surefire-reports/*.xml', allowEmptyResults: true - archiveDirs(stageId, ['core-it-suite-logs':'core-it-suite/target/test-classes', - 'core-it-suite-reports':'core-it-suite/target/surefire-reports']) - } - } - } finally { - deleteDir() // clean up after ourselves to reduce disk space - } - } - } - } - } - } -} - -// run the parallel ITs -parallel(runITsTasks) - -// JENKINS-34376 seems to make it hard to detect the aborted builds -} catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) { - echo "[FAILURE-002] FlowInterruptedException ${e}" - // this ambiguous condition means a user probably aborted - if (e.causes.size() == 0) { - currentBuild.result = "ABORTED" - } else { - currentBuild.result = "FAILURE" - } - throw e -} catch (hudson.AbortException e) { - echo "[FAILURE-003] AbortException ${e}" - // this ambiguous condition means during a shell step, user probably aborted - if (e.getMessage().contains('script returned exit code 143')) { - currentBuild.result = "ABORTED" - } else { - currentBuild.result = "FAILURE" - } - throw e -} catch (InterruptedException e) { - echo "[FAILURE-004] ${e}" - currentBuild.result = "ABORTED" - throw e -} catch (Throwable e) { - echo "[FAILURE-001] ${e}" - currentBuild.result = "FAILURE" - throw e -} finally { - // notify completion - stage("Notifications") { - jenkinsNotify() - } -} - -def archiveDirs(stageId, archives) { - archives.each { archivePrefix, pathToContent -> - if (fileExists(pathToContent)) { - zip(zipFile: "${archivePrefix}-${stageId}.zip", dir: pathToContent, archive: true) - } - } -} diff --git a/disabled-Jenkinsfile.its b/disabled-Jenkinsfile.its deleted file mode 100644 index d52c179fb918..000000000000 --- a/disabled-Jenkinsfile.its +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -pipeline { - agent { node { label 'ubuntu' } } - options { - durabilityHint('PERFORMANCE_OPTIMIZED') - buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '5')) - timeout(time: 180, unit: 'MINUTES') - } - parameters { - string( defaultValue: 'master', description: 'Core Its branch (default master)', - name: 'ITS_BRANCH' ) - } - stages { - stage("Build Maven Core") { - steps { - withEnv(["JAVA_HOME=${ tool "JDK 1.8 (latest)" }", "PATH+MAVEN=${tool 'Maven 3.6.3'}/bin:${env.JAVA_HOME}/bin"]) { - sh "mvn -Drat.skip=true -T2 -B -V install -PversionlessMavenDist -Dmaven.repo.local=${env.WORKSPACE}/repo" - } - } - } - stage( "Run Maven Integration Testing" ) { - steps { - git url: "https://github.com/apache/maven-integration-testing.git", branch: "${ITS_BRANCH}" - sh "ls -lrt ${env.WORKSPACE}/apache-maven/target/" - withEnv(["JAVA_HOME=${ tool "JDK 1.8 (latest)" }", "PATH+MAVEN=${tool 'Maven 3.6.3'}/bin:${env.JAVA_HOME}/bin"]) { - sh "mvn clean install -V -B -Prun-its,embedded -Dmaven.test.failure.ignore -Dmaven.repo.local=${env.WORKSPACE}/repo -DmavenDistro=${env.WORKSPACE}/apache-maven/target/apache-maven-bin.zip" - } - } - } - } - post { - always { - junit testResults: 'core-it-suite/target/surefire-reports/*.xml', allowEmptyResults: true - script{ - currentBuild.description = "Build with Core Its branch:$ITS_BRANCH" - } - cleanWs() - } - } -} diff --git a/disabled-Jenkinsfile.s390x b/disabled-Jenkinsfile.s390x deleted file mode 100644 index ef01369fa668..000000000000 --- a/disabled-Jenkinsfile.s390x +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -properties([buildDiscarder(logRotator(artifactNumToKeepStr: '5', numToKeepStr: env.BRANCH_NAME=='master'?'5':'1'))]) - -def buildOs = 'linux' -def buildJdk = '17' -def buildMvn = '3.8.x' -def runITsOses = ['linux'] -def runITsJdks = ['17'] -def runITsMvn = '3.8.x' -def runITscommand = "mvn clean install -Prun-its,embedded -B -U -V" // -DmavenDistro=... -Dmaven.test.failure.ignore=true -def tests - -try { - -def osNode = jenkinsEnv.labelForOS(buildOs) -node('s390x') { - dir('build') { - stage('Checkout') { - checkout scm - } - - def WORK_DIR=pwd() - def MAVEN_GOAL='verify' - - stage('Build / Unit Test') { - String jdkName = jenkinsEnv.jdkFromVersion(buildOs, buildJdk) - String mvnName = jenkinsEnv.mvnFromVersion(buildOs, buildMvn) - try { - withEnv(["JAVA_HOME=${ tool "$jdkName" }", - "PATH+MAVEN=${ tool "$jdkName" }/bin:${tool "$mvnName"}/bin", - "MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) { - sh "mvn clean ${MAVEN_GOAL} -B -U -e -fae -V -Dmaven.test.failure.ignore -PversionlessMavenDist -Dmaven.repo.local=${WORK_DIR}/.repository" - } - } finally { - junit testResults: '**/target/surefire-reports/*.xml,**/target/failsafe-reports/*.xml', allowEmptyResults: true - } - dir ('apache-maven/target') { - stash includes: 'apache-maven-bin.zip', name: 'maven-dist-s390x' - } - } - } -} - -Map runITsTasks = [:] -for (String os in runITsOses) { - for (def jdk in runITsJdks) { - String osLabel = jenkinsEnv.labelForOS(os); - String jdkName = jenkinsEnv.jdkFromVersion(os, "${jdk}") - String mvnName = jenkinsEnv.mvnFromVersion(os, "${runITsMvn}") - echo "OS: ${os} JDK: ${jdk} => Label: ${osLabel} JDK: ${jdkName} Arch: s390x" - - String stageId = "${os}-jdk${jdk}-s390x" - String stageLabel = "Run ITs ${os.capitalize()} Java ${jdk} on s390x" - runITsTasks[stageId] = { - node('s390x') { - stage("${stageLabel}") { - echo "NODE_NAME = ${env.NODE_NAME}" - // on Windows, need a short path or we hit 256 character limit for paths - // using EXECUTOR_NUMBER guarantees that concurrent builds on same agent - // will not trample each other plus workaround for JENKINS-52657 - dir(isUnix() ? 'test' : "c:\\mvn-it-${EXECUTOR_NUMBER}.tmp") { - def WORK_DIR=pwd() - def ITS_BRANCH = env.CHANGE_BRANCH != null ? env.CHANGE_BRANCH : env.BRANCH_NAME; - try { - echo "Checkout ITs from branch: ${ITS_BRANCH}" - checkout([$class: 'GitSCM', - branches: [[name: ITS_BRANCH]], - extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]], - userRemoteConfigs: [[url: 'https://github.com/apache/maven-integration-testing.git']]]) - } catch (Throwable e) { - echo "Failure checkout ITs branch: ${ITS_BRANCH} - fallback master branch" - checkout([$class: 'GitSCM', - branches: [[name: "*/master"]], - extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]], - userRemoteConfigs: [[url: 'https://github.com/apache/maven-integration-testing.git']]]) - } - if (isUnix()) { - sh "rm -rvf $WORK_DIR/dists $WORK_DIR/it-local-repo" - } else { - bat "if exist it-local-repo rmdir /s /q it-local-repo" - bat "if exist dists rmdir /s /q dists" - } - dir('dists') { - unstash 'maven-dist-s390x' - } - try { - withEnv(["JAVA_HOME=${ tool "$jdkName" }", - "PATH+MAVEN=${ tool "$jdkName" }/bin:${tool "$mvnName"}/bin", - "MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) { - String cmd = "${runITscommand} -Dmaven.repo.local=$WORK_DIR/it-local-repo -DmavenDistro=$WORK_DIR/dists/apache-maven-bin.zip -Dmaven.test.failure.ignore" - - if (isUnix()) { - sh 'df -hT' - sh "${cmd}" - } else { - bat 'wmic logicaldisk get size,freespace,caption' - bat "${cmd}" - } - } - } finally { - // in ITs test we need only reports from test itself - // test projects can contain reports with tested failed builds - junit testResults: '**/core-it-suite/target/surefire-reports/*.xml,**/core-it-support/**/target/surefire-reports/*.xml', allowEmptyResults: true - archiveDirs(stageId, ['core-it-suite-logs':'core-it-suite/target/test-classes', - 'core-it-suite-reports':'core-it-suite/target/surefire-reports']) - deleteDir() // clean up after ourselves to reduce disk space - } - } - } - } - } - } -} - -// run the parallel ITs -parallel(runITsTasks) - -// JENKINS-34376 seems to make it hard to detect the aborted builds -} catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) { - echo "[FAILURE-002] FlowInterruptedException ${e}" - // this ambiguous condition means a user probably aborted - if (e.causes.size() == 0) { - currentBuild.result = "ABORTED" - } else { - currentBuild.result = "FAILURE" - } - throw e -} catch (hudson.AbortException e) { - echo "[FAILURE-003] AbortException ${e}" - // this ambiguous condition means during a shell step, user probably aborted - if (e.getMessage().contains('script returned exit code 143')) { - currentBuild.result = "ABORTED" - } else { - currentBuild.result = "FAILURE" - } - throw e -} catch (InterruptedException e) { - echo "[FAILURE-004] ${e}" - currentBuild.result = "ABORTED" - throw e -} catch (Throwable e) { - echo "[FAILURE-001] ${e}" - currentBuild.result = "FAILURE" - throw e -} - -def archiveDirs(stageId, archives) { - archives.each { archivePrefix, pathToContent -> - if (fileExists(pathToContent)) { - zip(zipFile: "${archivePrefix}-${stageId}.zip", dir: pathToContent, archive: true) - } - } -} diff --git a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java index 053b860d7055..744dcfd8c6d7 100644 --- a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java +++ b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java @@ -23,6 +23,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; +import java.util.Arrays; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -260,6 +261,17 @@ protected Verifier newVerifier(String basedir, boolean debug) throws Verificatio protected Verifier newVerifier(String basedir, String settings, boolean debug) throws VerificationException { Verifier verifier = new Verifier(basedir); + // try to get jacoco arg from command line if any then use it to start IT to populate jacoco data + // we use a different file than the main one + ProcessHandle.current() + .info() + .arguments() + .flatMap(strings -> Arrays.stream(strings) + .filter(s -> s.contains("-javaagent:") && s.contains("org.jacoco.agent")) + .findFirst()) + .map(s -> s.replace("jacoco.exec", "jacoco-its.exec")) + .ifPresent(verifier::addJvmArgument); + verifier.setAutoclean(false); if (settings != null) { diff --git a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java index 848b829fa822..04be2c6dbfa8 100644 --- a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java +++ b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java @@ -106,6 +106,8 @@ public class Verifier { private final List cliArguments = new ArrayList<>(); + private final List jvmArguments = new ArrayList<>(); + private Path userHomeDirectory; // the user home private String executable = ExecutorRequest.MVN; @@ -218,6 +220,7 @@ public void execute() throws VerificationException { .command(executable) .cwd(basedir) .userHomeDirectory(userHomeDirectory) + .jvmArguments(jvmArguments) .arguments(args); if (!systemProperties.isEmpty()) { builder.jvmSystemProperties(new HashMap(systemProperties)); @@ -269,6 +272,15 @@ public void addCliArgument(String cliArgument) { cliArguments.add(cliArgument); } + /** + * Add a jvm argument, each argument must be set separately one by one. + * + * @param jvmArgument an argument to add + */ + public void addJvmArgument(String jvmArgument) { + jvmArguments.add(jvmArgument); + } + /** * Add a command line arguments, each argument must be set separately one by one. *

diff --git a/pom.xml b/pom.xml index 956bc27b752e..dc4f095689e4 100644 --- a/pom.xml +++ b/pom.xml @@ -170,6 +170,7 @@ under the License. 3.5.3 7.1.0 2.10.0 + @@ -701,7 +702,7 @@ under the License. 3.5.2 - -Xmx256m + -Xmx256m @{jacocoArgLine} @@ -755,6 +756,13 @@ under the License. build-helper-maven-plugin 3.6.0 + + org.apache.maven.plugins + maven-deploy-plugin + + true + + org.codehaus.mojo buildnumber-maven-plugin @@ -769,9 +777,29 @@ under the License. true + + org.jacoco + jacoco-maven-plugin + 0.8.12 + + + **/org/apache/maven/it/** + **/org/apache/maven/its/** + **/org/apache/maven/coreit/** + **/org/apache/maven/plugin/coreit/** + **/org/apache/maven/wagon/providers/coreit/** + **/org/apache/maven/coreits/** + + + + + io.github.olamy.maven.plugins + jacoco-aggregator-maven-plugin + 1.0.0 + org.apache.maven.plugins maven-doap-plugin @@ -795,6 +823,7 @@ under the License. false + Jenkinsfile **/.gitattributes src/test/resources*/** src/test/projects/** @@ -1067,5 +1096,64 @@ under the License. its + + ci + + + + + org.apache.maven.plugins + maven-surefire-plugin + + ${project.build.directory}/test-results-surefire + + + + + + + + jacoco + + + + org.apache.maven.plugins + maven-surefire-plugin + + -Xmx1G @{jacocoArgLine} + ${project.build.directory}/test-results-surefire + + + + org.jacoco + jacoco-maven-plugin + + + jacoco-initialize + + prepare-agent + + initialize + + jacocoArgLine + + + + jacoco-site + + report + + package + + + **/org/apache/maven/** + + + + + + + + From 13b82c17283f35ef79ee922bb46a4270dff67324 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 11:09:59 +0100 Subject: [PATCH 07/10] [MNG-8626] Bump org.junit:junit-bom from 5.12.0 to 5.12.1 (#2155) Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.12.0 to 5.12.1. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.12.0...r5.12.1) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- https://issues.apache.org/jira/browse/MNG-8626 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dc4f095689e4..ea7b0732a3a5 100644 --- a/pom.xml +++ b/pom.xml @@ -154,7 +154,7 @@ under the License. 2.0.1 1.3.2 3.29.0 - 5.12.0 + 5.12.1 1.3 1.5.17 5.16.0 From cebb7bd4f7fb3673251e66d0d5b40d50f77c8f12 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 11:11:07 +0100 Subject: [PATCH 08/10] [MNG-8627] Bump mockitoVersion from 5.16.0 to 5.16.1 (#2156) Bumps `mockitoVersion` from 5.16.0 to 5.16.1. Updates `org.mockito:mockito-bom` from 5.16.0 to 5.16.1 - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.16.0...v5.16.1) Updates `org.mockito:mockito-junit-jupiter` from 5.16.0 to 5.16.1 - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.16.0...v5.16.1) --- updated-dependencies: - dependency-name: org.mockito:mockito-bom dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.mockito:mockito-junit-jupiter dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- https://issues.apache.org/jira/browse/MNG-8627 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ea7b0732a3a5..04805ad9d767 100644 --- a/pom.xml +++ b/pom.xml @@ -157,7 +157,7 @@ under the License. 5.12.1 1.3 1.5.17 - 5.16.0 + 5.16.1 1.3 1.27 1.4.0 From af3e4da874c9f19314f0c8f1410f91ce0842f59a Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Wed, 19 Mar 2025 15:49:43 +0100 Subject: [PATCH 09/10] Up m-assembly-p to latest 3.7.1 from 3.4.0 As it seems 3.4.0 have issues and omits required properties. --- .../resources/mng-5895-ci-friendly-usage-with-property/pom.xml | 2 +- .../src/test/resources/mng-6090-ci-friendly/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/its/core-it-suite/src/test/resources/mng-5895-ci-friendly-usage-with-property/pom.xml b/its/core-it-suite/src/test/resources/mng-5895-ci-friendly-usage-with-property/pom.xml index 476e41949784..9c2c7c7e6628 100644 --- a/its/core-it-suite/src/test/resources/mng-5895-ci-friendly-usage-with-property/pom.xml +++ b/its/core-it-suite/src/test/resources/mng-5895-ci-friendly-usage-with-property/pom.xml @@ -40,7 +40,7 @@ under the License. org.apache.maven.plugins maven-assembly-plugin - 3.4.0 + 3.7.1 org.apache.maven.plugins diff --git a/its/core-it-suite/src/test/resources/mng-6090-ci-friendly/pom.xml b/its/core-it-suite/src/test/resources/mng-6090-ci-friendly/pom.xml index 41c59a0a8161..fd95510fe87b 100644 --- a/its/core-it-suite/src/test/resources/mng-6090-ci-friendly/pom.xml +++ b/its/core-it-suite/src/test/resources/mng-6090-ci-friendly/pom.xml @@ -41,7 +41,7 @@ under the License. org.apache.maven.plugins maven-assembly-plugin - 3.4.0 + 3.7.1 org.apache.maven.plugins From 9ab531930cffbdf3be21ff38014a88212ed5df33 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Wed, 19 Mar 2025 16:36:20 +0100 Subject: [PATCH 10/10] Revert "Up m-assembly-p to latest 3.7.1 from 3.4.0" This reverts commit af3e4da874c9f19314f0c8f1410f91ce0842f59a. --- .../resources/mng-5895-ci-friendly-usage-with-property/pom.xml | 2 +- .../src/test/resources/mng-6090-ci-friendly/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/its/core-it-suite/src/test/resources/mng-5895-ci-friendly-usage-with-property/pom.xml b/its/core-it-suite/src/test/resources/mng-5895-ci-friendly-usage-with-property/pom.xml index 9c2c7c7e6628..476e41949784 100644 --- a/its/core-it-suite/src/test/resources/mng-5895-ci-friendly-usage-with-property/pom.xml +++ b/its/core-it-suite/src/test/resources/mng-5895-ci-friendly-usage-with-property/pom.xml @@ -40,7 +40,7 @@ under the License. org.apache.maven.plugins maven-assembly-plugin - 3.7.1 + 3.4.0 org.apache.maven.plugins diff --git a/its/core-it-suite/src/test/resources/mng-6090-ci-friendly/pom.xml b/its/core-it-suite/src/test/resources/mng-6090-ci-friendly/pom.xml index fd95510fe87b..41c59a0a8161 100644 --- a/its/core-it-suite/src/test/resources/mng-6090-ci-friendly/pom.xml +++ b/its/core-it-suite/src/test/resources/mng-6090-ci-friendly/pom.xml @@ -41,7 +41,7 @@ under the License. org.apache.maven.plugins maven-assembly-plugin - 3.7.1 + 3.4.0 org.apache.maven.plugins