From 33bb1bece17d1b6f6e81b149828fa1287aa61093 Mon Sep 17 00:00:00 2001 From: Roland Grunberg Date: Tue, 12 Jun 2012 09:56:38 -0400 Subject: [PATCH] Fix the Tycho build to work on Fedora. Minor fixes of limited scope needed to have Tycho building on Fedora. Tycho upstream currently depends upon 0.15.0 when building 0.16.0-SNAPSHOT, which doesn't have reactor plugin version checking. In Fedora we depend on the previously built version which has that version checking. We must keep previous build version strings different to avoid a cyclic dependency, but doing so causes the version checking to fail, so we must provide a way to disable it. Disable by default. Update to using Jetty 9 API. Update to using maven-surefire 2.18. Change-Id: Ic8c0514c1fa10ee53580d2654ac6a363ccd66814 --- .../eclipse/tycho/p2/target/ee/CustomEEResolutionHandler.java | 2 +- .../src/main/java/org/eclipse/tycho/test/util/HttpServer.java | 8 ++++++-- .../tycho/core/maven/TychoMavenLifecycleParticipant.java | 4 +++- .../eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter.java | 2 +- .../org/eclipse/tycho/test/AbstractTychoIntegrationTest.java | 11 +++++------ 8 files changed, 17 insertions(+), 14 deletions(-) diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/ee/CustomEEResolutionHandler.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/ee/CustomEEResolutionHandler.java index 7afa13e..82962f9 100644 --- a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/ee/CustomEEResolutionHandler.java +++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/ee/CustomEEResolutionHandler.java @@ -59,7 +59,7 @@ class CustomEEResolutionHandler extends ExecutionEnvironmentResolutionHandler { String name = capability.getName(); String version = capability.getVersion().toString(); - if (JREAction.NAMESPACE_OSGI_EE.equals(namespace)) { + if ("osgi.ee".equals(namespace)) { result.add(new SystemCapability(Type.OSGI_EE, name, version)); } else if (PublisherHelper.CAPABILITY_NS_JAVA_PACKAGE.equals(namespace)) { result.add(new SystemCapability(Type.JAVA_PACKAGE, name, version)); diff --git a/tycho-bundles/org.eclipse.tycho.test.utils/src/main/java/org/eclipse/tycho/test/util/HttpServer.java b/tycho-bundles/org.eclipse.tycho.test.utils/src/main/java/org/eclipse/tycho/test/util/HttpServer.java index 6e65627..eefc753 100644 --- a/tycho-bundles/org.eclipse.tycho.test.utils/src/main/java/org/eclipse/tycho/test/util/HttpServer.java +++ b/tycho-bundles/org.eclipse.tycho.test.utils/src/main/java/org/eclipse/tycho/test/util/HttpServer.java @@ -17,6 +17,11 @@ import java.util.List; import java.util.Map; import java.util.Random; +import org.eclipse.jetty.security.ConstraintMapping; +import org.eclipse.jetty.security.ConstraintSecurityHandler; +import org.eclipse.jetty.security.HashLoginService; +import org.eclipse.jetty.server.AbstractNetworkConnector; +import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.servlet.ServletContextHandler; @@ -76,8 +81,7 @@ public class HttpServer extends ExternalResource { private static RunningServer startServerOnPort(int port) throws Exception { Server jetty = new Server(); - ServerConnector connector = new ServerConnector(jetty); - connector.setHost("localhost"); + AbstractNetworkConnector connector = new ServerConnector(jetty); connector.setPort(port); jetty.addConnector(connector); diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java index b00c344..bc05c2d 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java @@ -102,7 +102,9 @@ public class TychoMavenLifecycleParticipant extends AbstractMavenLifecyclePartic } private void validate(List projects) throws MavenExecutionException { - validateConsistentTychoVersion(projects); + if (System.getProperty("tycho.enableVersionCheck") != null) { + validateConsistentTychoVersion(projects); + } validateUniqueBaseDirs(projects); } diff --git a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter.java b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter.java index 26afcd4..19eeab9 100644 --- a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter.java +++ b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter.java @@ -84,7 +84,7 @@ public class OsgiSurefireBooter { extractProviderProperties(testProps), null, false); StartupReportConfiguration startupReportConfig = new StartupReportConfiguration(useFile, printSummary, StartupReportConfiguration.PLAIN_REPORT_FORMAT, redirectTestOutputToFile, disableXmlReport, reportsDir, - trimStacktrace, null, "TESTHASH", false); + trimStacktrace, null, "TESTHASH", false, 0); ReporterFactory reporterFactory = new DefaultReporterFactory(startupReportConfig); // API indicates we should use testClassLoader below but surefire also tries // to load surefire classes using this classloader diff --git a/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/AbstractTychoIntegrationTest.java b/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/AbstractTychoIntegrationTest.java index 097bdeb..f90b10c 100644 --- a/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/AbstractTychoIntegrationTest.java +++ b/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/AbstractTychoIntegrationTest.java @@ -115,12 +115,11 @@ public abstract class AbstractTychoIntegrationTest { verifier.getCliOptions().add(customOptions); } - if (System.getProperty(SYSPROP_STATELOCATION) != null) { - verifier.setForkJvm(false); - String m2eresolver = System.getProperty("tychodev-maven.ext.class.path"); // XXX - if (m2eresolver != null) { - verifier.addCliOption("-Dmaven.ext.class.path=" + m2eresolver); - } + String m2eState = System.getProperty("m2eclipse.workspace.state"); + String m2eResolver = System.getProperty("m2eclipse.workspace.resolver"); + + if (m2eState != null && m2eResolver != null) { + verifier.getVerifierProperties().put("m2eclipse.workspace.state", m2eState); } return verifier; -- 2.1.0