Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Sievers2012-10-18 10:29:46 -0400
committerJan Sievers2012-10-19 04:07:18 -0400
commitafffd13da5402c177e91710d070d488b55071d3c (patch)
treea3830a2bc7076665b4c921c6e08c8817e601dfba
parente756c77b8b1bf807288c215ea7859a2c04fed5cc (diff)
downloadorg.eclipse.tycho-tycho-0.16.x.tar.gz
org.eclipse.tycho-tycho-0.16.x.tar.xz
org.eclipse.tycho-tycho-0.16.x.zip
392193 Omit check for duplicate IUs in TestMojotycho-0.16.0tycho-0.16.x
When computing the target platform in TestMojo, omit the check for duplicate IUs produced in the reactor. Duplicate a.jre.* IUs (which are in fact identical) can be produced if several products are published. This is a workaround for 0.16.0, a better solution for 0.17.0 should be addressed with fix for bug 392320. Change-Id: Ia4282b6682126cedb92cb161e889048db493de4d Bug: 392193
-rw-r--r--tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBuilderImpl.java8
-rw-r--r--tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformBuilder.java2
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/TargetPlatformResolver.java2
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/LocalTargetPlatformResolver.java2
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTychoDependencyResolver.java2
-rw-r--r--tycho-its/projects/product.duplicateIUs/bundle.test/META-INF/MANIFEST.MF7
-rw-r--r--tycho-its/projects/product.duplicateIUs/bundle.test/build.properties4
-rw-r--r--tycho-its/projects/product.duplicateIUs/bundle.test/pom.xml13
-rw-r--r--tycho-its/projects/product.duplicateIUs/bundle.test/src/bundle/test/JUnit3Test.java20
-rw-r--r--tycho-its/projects/product.duplicateIUs/pom.xml40
-rw-r--r--tycho-its/projects/product.duplicateIUs/product1/pom.xml14
-rw-r--r--tycho-its/projects/product.duplicateIUs/product1/product1.product15
-rw-r--r--tycho-its/projects/product.duplicateIUs/product2/pom.xml14
-rw-r--r--tycho-its/projects/product.duplicateIUs/product2/product2.product15
-rw-r--r--tycho-its/src/test/java/org/eclipse/tycho/test/product/duplicateius/ProductDuplicateIUsTest.java27
-rw-r--r--tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java4
-rw-r--r--tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java3
17 files changed, 185 insertions, 7 deletions
diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBuilderImpl.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBuilderImpl.java
index 926583917..c56eeffcb 100644
--- a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBuilderImpl.java
+++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBuilderImpl.java
@@ -88,6 +88,7 @@ public class TargetPlatformBuilderImpl implements TargetPlatformBuilder {
private final TargetDefinitionResolverService targetDefinitionResolverService;
private boolean includePackedArtifacts;
+ private boolean failOnDuplicateIUs = true;
/**
* Representation of the target execution environment profile. In case of a custom EE profile,
@@ -466,7 +467,8 @@ public class TargetPlatformBuilderImpl implements TargetPlatformBuilder {
}
}
- if (!duplicateReactorUIs.isEmpty()) {
+ if (failOnDuplicateIUs && !duplicateReactorUIs.isEmpty()) {
+ // TODO 392320 we should only fail if IUs with same id and version but different content are found
throw new DuplicateReactorIUsException(duplicateReactorUIs);
}
@@ -490,4 +492,8 @@ public class TargetPlatformBuilderImpl implements TargetPlatformBuilder {
public void setIncludePackedArtifacts(boolean include) {
this.includePackedArtifacts = include;
}
+
+ public void setFailOnDuplicateIUs(boolean failOnDuplicateIUs) {
+ this.failOnDuplicateIUs = failOnDuplicateIUs;
+ }
}
diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformBuilder.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformBuilder.java
index b33a6e939..7753b11d9 100644
--- a/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformBuilder.java
+++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformBuilder.java
@@ -45,4 +45,6 @@ public interface TargetPlatformBuilder {
public void setIncludePackedArtifacts(boolean include);
+ public void setFailOnDuplicateIUs(boolean fail);
+
}
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/TargetPlatformResolver.java b/tycho-core/src/main/java/org/eclipse/tycho/core/TargetPlatformResolver.java
index 73c44ba4b..f7436bd2c 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/TargetPlatformResolver.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/TargetPlatformResolver.java
@@ -29,7 +29,7 @@ public interface TargetPlatformResolver {
public void setupProjects(MavenSession session, MavenProject project, ReactorProject reactorProject);
public TargetPlatform computeTargetPlatform(MavenSession session, MavenProject project,
- List<ReactorProject> reactorProjects);
+ List<ReactorProject> reactorProjects, boolean failOnDuplicateIUs);
public DependencyArtifacts resolveDependencies(MavenSession session, MavenProject project,
TargetPlatform resolutionContext, List<ReactorProject> reactorProjects,
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/LocalTargetPlatformResolver.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/LocalTargetPlatformResolver.java
index b75e233ac..8a9800d19 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/LocalTargetPlatformResolver.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/LocalTargetPlatformResolver.java
@@ -98,7 +98,7 @@ public class LocalTargetPlatformResolver extends AbstractTargetPlatformResolver
}
public TargetPlatform computeTargetPlatform(MavenSession session, MavenProject project,
- List<ReactorProject> reactorProjects) {
+ List<ReactorProject> reactorProjects, boolean failOnDuplicateIUs) {
// everything is done in resolveDependencies
return null;
}
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTychoDependencyResolver.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTychoDependencyResolver.java
index de79c6c91..52ddd1f7a 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTychoDependencyResolver.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTychoDependencyResolver.java
@@ -91,7 +91,7 @@ public class DefaultTychoDependencyResolver implements TychoDependencyResolver {
// TODO 364134 cache target platform (e.g. by checking if there is already an attached target platform)
logger.info("Computing target platform for " + project);
- TargetPlatform targetPlatform = resolver.computeTargetPlatform(session, project, reactorProjects);
+ TargetPlatform targetPlatform = resolver.computeTargetPlatform(session, project, reactorProjects, true);
dr.setTargetPlatform(project, targetPlatform);
diff --git a/tycho-its/projects/product.duplicateIUs/bundle.test/META-INF/MANIFEST.MF b/tycho-its/projects/product.duplicateIUs/bundle.test/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..7b4e8fd99
--- /dev/null
+++ b/tycho-its/projects/product.duplicateIUs/bundle.test/META-INF/MANIFEST.MF
@@ -0,0 +1,7 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Test Plug-in
+Bundle-SymbolicName: bundle.test
+Bundle-Version: 0.0.1.qualifier
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.junit;bundle-version="3.8.2"
diff --git a/tycho-its/projects/product.duplicateIUs/bundle.test/build.properties b/tycho-its/projects/product.duplicateIUs/bundle.test/build.properties
new file mode 100644
index 000000000..34d2e4d2d
--- /dev/null
+++ b/tycho-its/projects/product.duplicateIUs/bundle.test/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/tycho-its/projects/product.duplicateIUs/bundle.test/pom.xml b/tycho-its/projects/product.duplicateIUs/bundle.test/pom.xml
new file mode 100644
index 000000000..9ef20fb5d
--- /dev/null
+++ b/tycho-its/projects/product.duplicateIUs/bundle.test/pom.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>tycho-its-project</groupId>
+ <artifactId>product.duplicateius.parent</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>bundle.test</artifactId>
+ <packaging>eclipse-test-plugin</packaging>
+</project>
diff --git a/tycho-its/projects/product.duplicateIUs/bundle.test/src/bundle/test/JUnit3Test.java b/tycho-its/projects/product.duplicateIUs/bundle.test/src/bundle/test/JUnit3Test.java
new file mode 100644
index 000000000..bce43d8b4
--- /dev/null
+++ b/tycho-its/projects/product.duplicateIUs/bundle.test/src/bundle/test/JUnit3Test.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * SAP AG - initial API and implementation
+ *******************************************************************************/
+package bundle.test;
+
+import junit.framework.TestCase;
+
+public class JUnit3Test extends TestCase {
+
+ public void testMe() {
+
+ }
+}
diff --git a/tycho-its/projects/product.duplicateIUs/pom.xml b/tycho-its/projects/product.duplicateIUs/pom.xml
new file mode 100644
index 000000000..1b180b96a
--- /dev/null
+++ b/tycho-its/projects/product.duplicateIUs/pom.xml
@@ -0,0 +1,40 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>tycho-its-project</groupId>
+ <artifactId>product.duplicateius.parent</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>product1</module>
+ <module>product2</module>
+
+ <!-- Bug 392193 showed up here: The two products built before both produced the same IUs
+ (e.g. tooling.source.default) and this stopped the build during the target platform
+ re-computation (which always includes everything from the local reactor) done for the
+ test runtime. -->
+ <module>bundle.test</module>
+ </modules>
+
+ <repositories>
+ <repository>
+ <id>test-data-repo</id>
+ <layout>p2</layout>
+ <url>${test-data-repo}</url>
+ </repository>
+ </repositories>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/tycho-its/projects/product.duplicateIUs/product1/pom.xml b/tycho-its/projects/product.duplicateIUs/product1/pom.xml
new file mode 100644
index 000000000..ae283acb4
--- /dev/null
+++ b/tycho-its/projects/product.duplicateIUs/product1/pom.xml
@@ -0,0 +1,14 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>tycho-its-project</groupId>
+ <artifactId>product.duplicateius.parent</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>product.duplicateius.product1</artifactId>
+ <packaging>eclipse-repository</packaging>
+
+</project>
diff --git a/tycho-its/projects/product.duplicateIUs/product1/product1.product b/tycho-its/projects/product.duplicateIUs/product1/product1.product
new file mode 100644
index 000000000..239fc8c24
--- /dev/null
+++ b/tycho-its/projects/product.duplicateIUs/product1/product1.product
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.5"?>
+
+<product uid="product.duplicateius.product1" version="0.0.1.qualifier" useFeatures="false" includeLaunchers="false">
+
+ <configIni use="default">
+ </configIni>
+
+ <launcherArgs>
+ </launcherArgs>
+
+ <plugins>
+ </plugins>
+
+</product>
diff --git a/tycho-its/projects/product.duplicateIUs/product2/pom.xml b/tycho-its/projects/product.duplicateIUs/product2/pom.xml
new file mode 100644
index 000000000..f4f34edcd
--- /dev/null
+++ b/tycho-its/projects/product.duplicateIUs/product2/pom.xml
@@ -0,0 +1,14 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>tycho-its-project</groupId>
+ <artifactId>product.duplicateius.parent</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>product.duplicateius.product2</artifactId>
+ <packaging>eclipse-repository</packaging>
+
+</project>
diff --git a/tycho-its/projects/product.duplicateIUs/product2/product2.product b/tycho-its/projects/product.duplicateIUs/product2/product2.product
new file mode 100644
index 000000000..94c5b42e6
--- /dev/null
+++ b/tycho-its/projects/product.duplicateIUs/product2/product2.product
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.5"?>
+
+<product uid="product.duplicateius.product2" version="0.0.1.qualifier" useFeatures="false" includeLaunchers="false">
+
+ <configIni use="default">
+ </configIni>
+
+ <launcherArgs>
+ </launcherArgs>
+
+ <plugins>
+ </plugins>
+
+</product>
diff --git a/tycho-its/src/test/java/org/eclipse/tycho/test/product/duplicateius/ProductDuplicateIUsTest.java b/tycho-its/src/test/java/org/eclipse/tycho/test/product/duplicateius/ProductDuplicateIUsTest.java
new file mode 100644
index 000000000..f0fbab653
--- /dev/null
+++ b/tycho-its/src/test/java/org/eclipse/tycho/test/product/duplicateius/ProductDuplicateIUsTest.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * SAP AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tycho.test.product.duplicateius;
+
+import org.apache.maven.it.Verifier;
+import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
+import org.eclipse.tycho.test.util.ResourceUtil.P2Repositories;
+import org.junit.Test;
+
+public class ProductDuplicateIUsTest extends AbstractTychoIntegrationTest {
+
+ @Test
+ public void testMultipleProductsNoDuplicateIUs() throws Exception {
+ Verifier verifier = getVerifier("product.duplicateIUs", false);
+ verifier.getSystemProperties().setProperty("test-data-repo", P2Repositories.ECLIPSE_342.toString());
+ verifier.executeGoal("integration-test");
+ verifier.verifyErrorFreeLog();
+ }
+}
diff --git a/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java b/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java
index 2ce9113f5..1c897b9bc 100644
--- a/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java
+++ b/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java
@@ -183,14 +183,14 @@ public class P2TargetPlatformResolver extends AbstractTargetPlatformResolver imp
}
public TargetPlatform computeTargetPlatform(MavenSession session, MavenProject project,
- List<ReactorProject> reactorProjects) {
+ List<ReactorProject> reactorProjects, boolean failOnDuplicateIUs) {
TargetPlatformConfiguration configuration = TychoProjectUtils.getTargetPlatformConfiguration(project);
ExecutionEnvironmentConfiguration ee = TychoProjectUtils.getExecutionEnvironmentConfiguration(project);
TargetPlatformBuilder tpBuilder = resolverFactory.createTargetPlatformBuilder(ee);
tpBuilder.setProjectLocation(project.getBasedir());
tpBuilder.setIncludePackedArtifacts(configuration.isIncludePackedArtifacts());
-
+ tpBuilder.setFailOnDuplicateIUs(failOnDuplicateIUs);
addThisReactorProjectToTargetPlatform(session, project, configuration, tpBuilder);
addOtherReactorProjectsToTargetPlatform(project, reactorProjects, tpBuilder);
diff --git a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java
index a676571c8..393007b36 100644
--- a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java
+++ b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java
@@ -469,7 +469,8 @@ public class TestMojo extends AbstractMojo {
dependencies.addAll(getTestDependencies());
// TODO 364134 re-use target platform from dependency resolution
- TargetPlatform targetPlatform = platformResolver.computeTargetPlatform(session, project, reactorProjects);
+ TargetPlatform targetPlatform = platformResolver
+ .computeTargetPlatform(session, project, reactorProjects, false);
final DependencyResolverConfiguration resolverConfiguration = new DependencyResolverConfiguration() {
public OptionalResolutionAction getOptionalResolutionAction() {

Back to the top