This is an automated email from the ASF dual-hosted git repository. kwin pushed a commit to branch bugfix/use-custom-property-for-repolocation in repository https://gitbox.apache.org/repos/asf/maven-apache-resources.git
commit 3410b1e9f590c766c248d6fc66d8d1f23e622904 Author: Konrad Windszus <k...@apache.org> AuthorDate: Fri Jul 12 20:25:22 2024 +0200 [MASFRES-70] Use custom property name for local IT repo Cannot use standard "maven.repo.local" because it is used by ASF Jenkins already and cannot be overwritten (https://issues.apache.org/jira/browse/SUREFIRE-1385) --- source-release/pom.xml | 4 +++- .../java/org/apache/its/IT_000_BasicArchiveCreation.java | 4 ++-- .../apache/its/IT_001_ExcludeBuildOutputDirectory.java | 3 ++- .../its/IT_002_IncludeSrcDirWithBuildOutputDirName.java | 3 ++- .../org/apache/its/IT_003_SharedResourceInclusion.java | 3 ++- .../src/test/java/org/apache/its/IT_004_IdeExcludes.java | 3 ++- .../java/org/apache/its/IT_005_MiscellaneousExcludes.java | 3 ++- .../src/test/java/org/apache/its/IT_006_CiExcludes.java | 3 ++- .../apache/its/IT_ExcludeSrcDirWithinBuildOutputDir.java | 3 ++- .../org/apache/its/IT_IncludeIdeFilesWithinSrcDir.java | 3 ++- .../test/java/org/apache/its/IT_ZipAndTarCreation.java | 3 ++- .../src/test/java/org/apache/its/util/TestUtils.java | 15 +++++++++++++++ 12 files changed, 38 insertions(+), 12 deletions(-) diff --git a/source-release/pom.xml b/source-release/pom.xml index aa052cd..6b265f1 100644 --- a/source-release/pom.xml +++ b/source-release/pom.xml @@ -135,9 +135,11 @@ under the License. <name>maven.home</name> <value>${preparedMavenHome}</value> </property> + <!-- cannot use property "maven.repo.local" as already used on as user property on the CLI through ASF Jenkins, + compare with https://issues.apache.org/jira/browse/SUREFIRE-1385 --> <property> <!-- Pass this through to the tests (if set!) to have them pick the right repository --> - <name>maven.repo.local</name> + <name>it.repo.local</name> <value>${project.build.directory}/it-repo</value> </property> </systemProperties> diff --git a/source-release/src/test/java/org/apache/its/IT_000_BasicArchiveCreation.java b/source-release/src/test/java/org/apache/its/IT_000_BasicArchiveCreation.java index 1b2160e..74872b3 100644 --- a/source-release/src/test/java/org/apache/its/IT_000_BasicArchiveCreation.java +++ b/source-release/src/test/java/org/apache/its/IT_000_BasicArchiveCreation.java @@ -33,6 +33,7 @@ import org.junit.Test; import static org.apache.its.util.TestUtils.archivePathFromChild; import static org.apache.its.util.TestUtils.archivePathFromProject; import static org.apache.its.util.TestUtils.assertZipContents; +import static org.apache.its.util.TestUtils.createVerifier; import static org.apache.its.util.TestUtils.getTestDir; public class IT_000_BasicArchiveCreation { @@ -44,8 +45,7 @@ public class IT_000_BasicArchiveCreation { public void execute() throws VerificationException, IOException, URISyntaxException { File testDir = getTestDir(BASENAME); - Verifier verifier = new Verifier(testDir.getAbsolutePath()); - + Verifier verifier = createVerifier(testDir); verifier.executeGoal("package"); verifier.verifyErrorFreeLog(); diff --git a/source-release/src/test/java/org/apache/its/IT_001_ExcludeBuildOutputDirectory.java b/source-release/src/test/java/org/apache/its/IT_001_ExcludeBuildOutputDirectory.java index a73299b..5158cc7 100644 --- a/source-release/src/test/java/org/apache/its/IT_001_ExcludeBuildOutputDirectory.java +++ b/source-release/src/test/java/org/apache/its/IT_001_ExcludeBuildOutputDirectory.java @@ -31,6 +31,7 @@ import org.junit.Test; import static org.apache.its.util.TestUtils.archivePathFromChild; import static org.apache.its.util.TestUtils.archivePathFromProject; import static org.apache.its.util.TestUtils.assertZipContents; +import static org.apache.its.util.TestUtils.createVerifier; import static org.apache.its.util.TestUtils.getTestDir; public class IT_001_ExcludeBuildOutputDirectory { @@ -42,7 +43,7 @@ public class IT_001_ExcludeBuildOutputDirectory { public void execute() throws VerificationException, IOException, URISyntaxException { File testDir = getTestDir(BASENAME); - Verifier verifier = new Verifier(testDir.getAbsolutePath()); + Verifier verifier = createVerifier(testDir); verifier.executeGoal("package"); diff --git a/source-release/src/test/java/org/apache/its/IT_002_IncludeSrcDirWithBuildOutputDirName.java b/source-release/src/test/java/org/apache/its/IT_002_IncludeSrcDirWithBuildOutputDirName.java index 8505112..5a0fa76 100644 --- a/source-release/src/test/java/org/apache/its/IT_002_IncludeSrcDirWithBuildOutputDirName.java +++ b/source-release/src/test/java/org/apache/its/IT_002_IncludeSrcDirWithBuildOutputDirName.java @@ -31,6 +31,7 @@ import org.junit.Test; import static org.apache.its.util.TestUtils.archivePathFromChild; import static org.apache.its.util.TestUtils.archivePathFromProject; import static org.apache.its.util.TestUtils.assertZipContents; +import static org.apache.its.util.TestUtils.createVerifier; import static org.apache.its.util.TestUtils.getTestDir; public class IT_002_IncludeSrcDirWithBuildOutputDirName { @@ -42,7 +43,7 @@ public class IT_002_IncludeSrcDirWithBuildOutputDirName { public void execute() throws VerificationException, IOException, URISyntaxException { File testDir = getTestDir(BASENAME); - Verifier verifier = new Verifier(testDir.getAbsolutePath()); + Verifier verifier = createVerifier(testDir); verifier.executeGoal("package"); diff --git a/source-release/src/test/java/org/apache/its/IT_003_SharedResourceInclusion.java b/source-release/src/test/java/org/apache/its/IT_003_SharedResourceInclusion.java index e7d905e..5c0378f 100644 --- a/source-release/src/test/java/org/apache/its/IT_003_SharedResourceInclusion.java +++ b/source-release/src/test/java/org/apache/its/IT_003_SharedResourceInclusion.java @@ -31,6 +31,7 @@ import org.junit.Test; import static org.apache.its.util.TestUtils.archivePathFromChild; import static org.apache.its.util.TestUtils.archivePathFromProject; import static org.apache.its.util.TestUtils.assertZipContents; +import static org.apache.its.util.TestUtils.createVerifier; import static org.apache.its.util.TestUtils.getTestDir; public class IT_003_SharedResourceInclusion { @@ -42,7 +43,7 @@ public class IT_003_SharedResourceInclusion { public void execute() throws VerificationException, IOException, URISyntaxException { File testDir = getTestDir(BASENAME); - Verifier verifier = new Verifier(testDir.getAbsolutePath()); + Verifier verifier = createVerifier(testDir); verifier.executeGoal("package"); diff --git a/source-release/src/test/java/org/apache/its/IT_004_IdeExcludes.java b/source-release/src/test/java/org/apache/its/IT_004_IdeExcludes.java index 472f5f5..b16a0e5 100644 --- a/source-release/src/test/java/org/apache/its/IT_004_IdeExcludes.java +++ b/source-release/src/test/java/org/apache/its/IT_004_IdeExcludes.java @@ -32,6 +32,7 @@ import org.junit.Test; import static org.apache.its.util.TestUtils.archivePathFromChild; import static org.apache.its.util.TestUtils.archivePathFromProject; import static org.apache.its.util.TestUtils.assertZipContents; +import static org.apache.its.util.TestUtils.createVerifier; import static org.apache.its.util.TestUtils.getTestDir; public class IT_004_IdeExcludes { @@ -43,7 +44,7 @@ public class IT_004_IdeExcludes { public void execute() throws VerificationException, IOException, URISyntaxException { File testDir = getTestDir(BASENAME); - Verifier verifier = new Verifier(testDir.getAbsolutePath()); + Verifier verifier = createVerifier(testDir); verifier.executeGoal("package"); diff --git a/source-release/src/test/java/org/apache/its/IT_005_MiscellaneousExcludes.java b/source-release/src/test/java/org/apache/its/IT_005_MiscellaneousExcludes.java index d986d60..efbe73b 100644 --- a/source-release/src/test/java/org/apache/its/IT_005_MiscellaneousExcludes.java +++ b/source-release/src/test/java/org/apache/its/IT_005_MiscellaneousExcludes.java @@ -32,6 +32,7 @@ import org.junit.Test; import static org.apache.its.util.TestUtils.archivePathFromChild; import static org.apache.its.util.TestUtils.archivePathFromProject; import static org.apache.its.util.TestUtils.assertZipContents; +import static org.apache.its.util.TestUtils.createVerifier; import static org.apache.its.util.TestUtils.getTestDir; public class IT_005_MiscellaneousExcludes { @@ -43,7 +44,7 @@ public class IT_005_MiscellaneousExcludes { public void execute() throws VerificationException, IOException, URISyntaxException { File testDir = getTestDir(BASENAME); - Verifier verifier = new Verifier(testDir.getAbsolutePath()); + Verifier verifier = createVerifier(testDir); verifier.executeGoal("package"); diff --git a/source-release/src/test/java/org/apache/its/IT_006_CiExcludes.java b/source-release/src/test/java/org/apache/its/IT_006_CiExcludes.java index 9623003..900dd79 100644 --- a/source-release/src/test/java/org/apache/its/IT_006_CiExcludes.java +++ b/source-release/src/test/java/org/apache/its/IT_006_CiExcludes.java @@ -31,6 +31,7 @@ import org.junit.Test; import static org.apache.its.util.TestUtils.archivePathFromProject; import static org.apache.its.util.TestUtils.assertZipContents; +import static org.apache.its.util.TestUtils.createVerifier; import static org.apache.its.util.TestUtils.getTestDir; public class IT_006_CiExcludes { @@ -42,7 +43,7 @@ public class IT_006_CiExcludes { public void execute() throws VerificationException, IOException, URISyntaxException { File testDir = getTestDir(BASENAME); - Verifier verifier = new Verifier(testDir.getAbsolutePath()); + Verifier verifier = createVerifier(testDir); verifier.executeGoal("package"); diff --git a/source-release/src/test/java/org/apache/its/IT_ExcludeSrcDirWithinBuildOutputDir.java b/source-release/src/test/java/org/apache/its/IT_ExcludeSrcDirWithinBuildOutputDir.java index af84dd8..80ff2dd 100644 --- a/source-release/src/test/java/org/apache/its/IT_ExcludeSrcDirWithinBuildOutputDir.java +++ b/source-release/src/test/java/org/apache/its/IT_ExcludeSrcDirWithinBuildOutputDir.java @@ -31,6 +31,7 @@ import org.junit.Test; import static org.apache.its.util.TestUtils.archivePathFromChild; import static org.apache.its.util.TestUtils.archivePathFromProject; import static org.apache.its.util.TestUtils.assertZipContents; +import static org.apache.its.util.TestUtils.createVerifier; import static org.apache.its.util.TestUtils.getTestDir; public class IT_ExcludeSrcDirWithinBuildOutputDir { @@ -42,7 +43,7 @@ public class IT_ExcludeSrcDirWithinBuildOutputDir { public void execute() throws VerificationException, IOException, URISyntaxException { File testDir = getTestDir(BASENAME); - Verifier verifier = new Verifier(testDir.getAbsolutePath()); + Verifier verifier = createVerifier(testDir); verifier.executeGoal("package"); diff --git a/source-release/src/test/java/org/apache/its/IT_IncludeIdeFilesWithinSrcDir.java b/source-release/src/test/java/org/apache/its/IT_IncludeIdeFilesWithinSrcDir.java index 714059a..6917e45 100644 --- a/source-release/src/test/java/org/apache/its/IT_IncludeIdeFilesWithinSrcDir.java +++ b/source-release/src/test/java/org/apache/its/IT_IncludeIdeFilesWithinSrcDir.java @@ -31,6 +31,7 @@ import org.junit.Test; import static org.apache.its.util.TestUtils.archivePathFromChild; import static org.apache.its.util.TestUtils.archivePathFromProject; import static org.apache.its.util.TestUtils.assertZipContents; +import static org.apache.its.util.TestUtils.createVerifier; import static org.apache.its.util.TestUtils.getTestDir; public class IT_IncludeIdeFilesWithinSrcDir { @@ -42,7 +43,7 @@ public class IT_IncludeIdeFilesWithinSrcDir { public void execute() throws VerificationException, IOException, URISyntaxException { File testDir = getTestDir(BASENAME); - Verifier verifier = new Verifier(testDir.getAbsolutePath()); + Verifier verifier = createVerifier(testDir); verifier.executeGoal("package"); diff --git a/source-release/src/test/java/org/apache/its/IT_ZipAndTarCreation.java b/source-release/src/test/java/org/apache/its/IT_ZipAndTarCreation.java index 223b287..d415b75 100644 --- a/source-release/src/test/java/org/apache/its/IT_ZipAndTarCreation.java +++ b/source-release/src/test/java/org/apache/its/IT_ZipAndTarCreation.java @@ -34,6 +34,7 @@ import static org.apache.its.util.TestUtils.archivePathFromChild; import static org.apache.its.util.TestUtils.archivePathFromProject; import static org.apache.its.util.TestUtils.assertTarContents; import static org.apache.its.util.TestUtils.assertZipContents; +import static org.apache.its.util.TestUtils.createVerifier; import static org.apache.its.util.TestUtils.getTestDir; public class IT_ZipAndTarCreation { @@ -45,7 +46,7 @@ public class IT_ZipAndTarCreation { public void execute() throws VerificationException, IOException, URISyntaxException { File testDir = getTestDir(BASENAME); - Verifier verifier = new Verifier(testDir.getAbsolutePath()); + Verifier verifier = createVerifier(testDir); verifier.executeGoal("package"); diff --git a/source-release/src/test/java/org/apache/its/util/TestUtils.java b/source-release/src/test/java/org/apache/its/util/TestUtils.java index 09f4c5e..db6f137 100644 --- a/source-release/src/test/java/org/apache/its/util/TestUtils.java +++ b/source-release/src/test/java/org/apache/its/util/TestUtils.java @@ -32,6 +32,8 @@ import java.util.zip.ZipException; import java.util.zip.ZipFile; import org.apache.commons.compress.archivers.ArchiveEntry; +import org.apache.maven.it.VerificationException; +import org.apache.maven.it.Verifier; import org.codehaus.plexus.archiver.tar.GZipTarFile; import static junit.framework.Assert.assertTrue; @@ -39,6 +41,19 @@ import static junit.framework.Assert.fail; public class TestUtils { + private static final String IT_REPO_LOCAL = "it.repo.local"; + + public static Verifier createVerifier(File testDir) throws VerificationException { + Verifier verifier = new Verifier(testDir.getAbsolutePath()); + // workaround for https://issues.apache.org/jira/browse/SUREFIRE-1385 + String itRepoLocal = System.getProperty(IT_REPO_LOCAL); + if (itRepoLocal != null) { + verifier.setLocalRepo(itRepoLocal); + } + // overwrite the local repo with the one set in property + return verifier; + } + public static String archivePathFromChild(String artifactId, String version, String childName, String childPath) { if (!childPath.startsWith("/")) { childPath = "/" + childPath;