diff --git a/tycho-its/projects/sameAbsoluteTarget/bundle1/META-INF/MANIFEST.MF b/tycho-its/projects/sameAbsoluteTarget/bundle1/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..1852b35810 --- /dev/null +++ b/tycho-its/projects/sameAbsoluteTarget/bundle1/META-INF/MANIFEST.MF @@ -0,0 +1,8 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: bundle +Bundle-SymbolicName: bundle +Bundle-Version: 1.0.0.qualifier +Bundle-RequiredExecutionEnvironment: JavaSE-11 +Automatic-Module-Name: bundle +Require-Bundle: org.apache.commons.lang3 diff --git a/tycho-its/projects/sameAbsoluteTarget/bundle1/build.properties b/tycho-its/projects/sameAbsoluteTarget/bundle1/build.properties new file mode 100644 index 0000000000..b107977f4e --- /dev/null +++ b/tycho-its/projects/sameAbsoluteTarget/bundle1/build.properties @@ -0,0 +1,3 @@ +source.. = src/ +bin.includes = META-INF/,\ + . diff --git a/tycho-its/projects/sameAbsoluteTarget/bundle1/pom.xml b/tycho-its/projects/sameAbsoluteTarget/bundle1/pom.xml new file mode 100644 index 0000000000..3f6b23f3e3 --- /dev/null +++ b/tycho-its/projects/sameAbsoluteTarget/bundle1/pom.xml @@ -0,0 +1,13 @@ + + + 4.0.0 + + tycho-its-project + sameAbsoluteTarget + 0.0.1-SNAPSHOT + + bundle + 1.0.0-SNAPSHOT + eclipse-plugin + diff --git a/tycho-its/projects/sameAbsoluteTarget/bundle2/META-INF/MANIFEST.MF b/tycho-its/projects/sameAbsoluteTarget/bundle2/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..c1080a3c0a --- /dev/null +++ b/tycho-its/projects/sameAbsoluteTarget/bundle2/META-INF/MANIFEST.MF @@ -0,0 +1,8 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: bundle2 +Bundle-SymbolicName: bundle2 +Bundle-Version: 1.0.0.qualifier +Bundle-RequiredExecutionEnvironment: JavaSE-11 +Automatic-Module-Name: bundle2 +Require-Bundle: org.apache.commons.lang3 diff --git a/tycho-its/projects/sameAbsoluteTarget/bundle2/build.properties b/tycho-its/projects/sameAbsoluteTarget/bundle2/build.properties new file mode 100644 index 0000000000..b107977f4e --- /dev/null +++ b/tycho-its/projects/sameAbsoluteTarget/bundle2/build.properties @@ -0,0 +1,3 @@ +source.. = src/ +bin.includes = META-INF/,\ + . diff --git a/tycho-its/projects/sameAbsoluteTarget/bundle2/pom.xml b/tycho-its/projects/sameAbsoluteTarget/bundle2/pom.xml new file mode 100644 index 0000000000..5092782ddb --- /dev/null +++ b/tycho-its/projects/sameAbsoluteTarget/bundle2/pom.xml @@ -0,0 +1,13 @@ + + + 4.0.0 + + tycho-its-project + sameAbsoluteTarget + 0.0.1-SNAPSHOT + + bundle2 + 1.0.0-SNAPSHOT + eclipse-plugin + diff --git a/tycho-its/projects/sameAbsoluteTarget/pom.xml b/tycho-its/projects/sameAbsoluteTarget/pom.xml new file mode 100644 index 0000000000..ccf3c14600 --- /dev/null +++ b/tycho-its/projects/sameAbsoluteTarget/pom.xml @@ -0,0 +1,38 @@ + + 4.0.0 + tycho-its-project + sameAbsoluteTarget + 0.0.1-SNAPSHOT + pom + + + bundle1 + bundle2 + + + + 11 + 11 + + + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho-version} + true + + + org.eclipse.tycho + target-platform-configuration + ${tycho-version} + + + ${basedir}/../target-platform/target-platform.target + + + + + + \ No newline at end of file diff --git a/tycho-its/projects/sameAbsoluteTarget/target-platform/target-platform.target b/tycho-its/projects/sameAbsoluteTarget/target-platform/target-platform.target new file mode 100644 index 0000000000..170b1274ee --- /dev/null +++ b/tycho-its/projects/sameAbsoluteTarget/target-platform/target-platform.target @@ -0,0 +1,16 @@ + + + + + + + + org.apache.commons + commons-lang3 + 3.8.1 + jar + + + + + \ No newline at end of file diff --git a/tycho-its/src/test/java/org/eclipse/tycho/test/target/DifferentTargetFilesSameAbsolutePathTest.java b/tycho-its/src/test/java/org/eclipse/tycho/test/target/DifferentTargetFilesSameAbsolutePathTest.java new file mode 100644 index 0000000000..f212a2e393 --- /dev/null +++ b/tycho-its/src/test/java/org/eclipse/tycho/test/target/DifferentTargetFilesSameAbsolutePathTest.java @@ -0,0 +1,27 @@ +package org.eclipse.tycho.test.target; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; + +import org.apache.maven.it.Verifier; +import org.eclipse.tycho.test.AbstractTychoIntegrationTest; +import org.junit.Test; + +public class DifferentTargetFilesSameAbsolutePathTest extends AbstractTychoIntegrationTest { + + @Test + public void test() throws Exception { + Verifier verifier = getVerifier("sameAbsoluteTarget"); + + verifier.executeGoals(List.of("clean", "verify")); + verifier.verifyErrorFreeLog(); + + // 2 modules with relative path to target, but identical absolute target file + // path + assertEquals(1, Files.lines(Path.of(verifier.getBasedir(), verifier.getLogFileName())) + .filter(line -> line.contains("Resolving target definition file")).count()); + } +}