Permalink
Browse files

364095 respect BREE during dependency resolution (part 1)

Updated P2 target platform resolver to respect project target
runtime execution environment.

Allowed explicit configuration of project target execution
environment both in pom.xml and in build.properties
(for backwards compatibility with PDE).

The same execution environment is used during dependency resolution
and by tycho-compiler-plugin.

Execution environment configuration is checked in the order
specified beflow and the first EE information found is used.

1. <executionEnvironment> target platform configuration parameter
2. For OSGi bundle projects, jre.compilation.profile build.properties
   to provide backwards compatibility with PDE
3. For OSGi bundle projects, smallest profile specified in
   Bundle-RequiredExecutionEnvironment OSGi bundle manifest attribute
4. Current JRE

Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
  • Loading branch information...
1 parent b96fb2a commit ffd3905192b24032ffc74e71917b1534b0e1a1e9 @ifedorenko ifedorenko committed Nov 17, 2011
Showing with 1,045 additions and 94 deletions.
  1. +1 −2 ...ycho.p2.resolver.facade/src/main/java/org/eclipse/tycho/p2/resolver/facade/P2ResolverFactory.java
  2. +0 −1 ...ycho.p2.resolver.facade/src/main/java/org/eclipse/tycho/p2/resolver/facade/ResolutionContext.java
  3. +25 −0 ...es/org.eclipse.tycho.p2.resolver.impl.test/resources/repositories/javax.xml-src/javax.xml/pom.xml
  4. +19 −0 ....impl.test/resources/repositories/javax.xml-src/javax.xml/src/main/java/org/w3c/dom/Document.java
  5. +23 −0 tycho-bundles/org.eclipse.tycho.p2.resolver.impl.test/resources/repositories/javax.xml/artifacts.xml
  6. +219 −0 tycho-bundles/org.eclipse.tycho.p2.resolver.impl.test/resources/repositories/javax.xml/content.xml
  7. BIN ...tycho.p2.resolver.impl.test/resources/repositories/javax.xml/plugins/javax.xml_0.0.1.SNAPSHOT.jar
  8. 0 tycho-bundles/org.eclipse.tycho.p2.resolver.impl.test/resources/repositories/p2.sh
  9. +7 −0 ...ndles/org.eclipse.tycho.p2.resolver.impl.test/resources/resolver/bundle.bree/META-INF/MANIFEST.MF
  10. +5 −0 ...les/org.eclipse.tycho.p2.resolver.impl.test/resources/resolver/bundle.nobree/META-INF/MANIFEST.MF
  11. +3 −3 ...p2.resolver.impl.test/src/test/java/org/eclipse/tycho/p2/impl/resolver/P2ResolverOfflineTest.java
  12. +63 −1 ....tycho.p2.resolver.impl.test/src/test/java/org/eclipse/tycho/p2/impl/resolver/P2ResolverTest.java
  13. +1 −1 ....test/src/test/java/org/eclipse/tycho/p2/impl/resolver/ResolutionContextDisableP2MirrorsTest.java
  14. +2 −2 ...ycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/impl/resolver/P2ResolverFactoryImpl.java
  15. +4 −2 ...lipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/impl/resolver/P2ResolverImpl.java
  16. +8 −2 ...2.resolver.impl/src/main/java/org/eclipse/tycho/p2/impl/resolver/ProjectorResolutionStrategy.java
  17. +41 −12 ...ycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/impl/resolver/ResolutionContextImpl.java
  18. +6 −0 ...e.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/impl/resolver/ResolutionStrategy.java
  19. +4 −0 ...se.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetDefinitionResolver.java
  20. +21 −58 tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java
  21. +9 −2 tycho-compiler-plugin/src/test/java/org/eclipse/tycho/osgicompiler/test/OsgiCompilerTest.java
  22. +6 −0 tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p004/META-INF/MANIFEST.MF
  23. +4 −0 tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p004/build.properties
  24. +35 −0 tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p004/pom.xml
  25. 0 tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p004/src/.gitignore
  26. +1 −0 tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/pom.xml
  27. +10 −0 tycho-core/src/main/java/org/eclipse/tycho/core/TargetPlatformConfiguration.java
  28. +6 −0 tycho-core/src/main/java/org/eclipse/tycho/core/TychoProject.java
  29. +17 −0 tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/AbstractTychoProject.java
  30. +2 −2 tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EquinoxResolver.java
  31. +50 −0 tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java
  32. +21 −0 ...-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTargetPlatformConfigurationReader.java
  33. +2 −2 tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTargetPlatformResolverFactory.java
  34. +7 −0 tycho-its/projects/364095_dependencyResolverBREE/ee-from-bree/META-INF/MANIFEST.MF
  35. +4 −0 tycho-its/projects/364095_dependencyResolverBREE/ee-from-bree/build.properties
  36. +33 −0 tycho-its/projects/364095_dependencyResolverBREE/ee-from-bree/pom.xml
  37. +7 −0 tycho-its/projects/364095_dependencyResolverBREE/ee-from-bree/src/test/w3c/TestW3C.java
  38. +5 −0 tycho-its/projects/364095_dependencyResolverBREE/ee-from-jre/META-INF/MANIFEST.MF
  39. +4 −0 tycho-its/projects/364095_dependencyResolverBREE/ee-from-jre/build.properties
  40. +25 −0 tycho-its/projects/364095_dependencyResolverBREE/ee-from-jre/pom.xml
  41. +7 −0 tycho-its/projects/364095_dependencyResolverBREE/ee-from-jre/src/test/w3c/TestW3C.java
  42. +7 −0 tycho-its/projects/364095_dependencyResolverBREE/ee-from-pom/META-INF/MANIFEST.MF
  43. +4 −0 tycho-its/projects/364095_dependencyResolverBREE/ee-from-pom/build.properties
  44. +33 −0 tycho-its/projects/364095_dependencyResolverBREE/ee-from-pom/pom.xml
  45. +7 −0 tycho-its/projects/364095_dependencyResolverBREE/ee-from-pom/src/test/w3c/TestW3C.java
  46. +23 −0 tycho-its/repositories/javax.xml/artifacts.xml
  47. +219 −0 tycho-its/repositories/javax.xml/content.xml
  48. BIN tycho-its/repositories/javax.xml/plugins/javax.xml_0.0.1.SNAPSHOT.jar
  49. +34 −0 ...c/test/java/org/eclipse/tycho/test/bug364095_dependencyResolverBREE/DependencyResolverEETest.java
  50. +11 −4 tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java
View
3 ...resolver.facade/src/main/java/org/eclipse/tycho/p2/resolver/facade/P2ResolverFactory.java
@@ -10,10 +10,9 @@
*******************************************************************************/
package org.eclipse.tycho.p2.resolver.facade;
-
public interface P2ResolverFactory {
- public ResolutionContext createResolutionContext(boolean disableP2Mirrors);
+ public ResolutionContext createResolutionContext(String bree, boolean disableP2Mirrors);
public P2Resolver createResolver();
}
View
1 ...resolver.facade/src/main/java/org/eclipse/tycho/p2/resolver/facade/ResolutionContext.java
@@ -50,5 +50,4 @@ public void addTargetDefinition(TargetDefinition definition, List<Map<String, St
* Releases all resources used by the resolver instance
*/
public void stop();
-
}
View
25 ...clipse.tycho.p2.resolver.impl.test/resources/repositories/javax.xml-src/javax.xml/pom.xml
@@ -0,0 +1,25 @@
+<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>tychp-its-data</groupId>
+ <artifactId>javax.xml</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>2.3.5</version>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Export-Package>org.w3c.dom</Export-Package>
+ <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
View
19 ...st/resources/repositories/javax.xml-src/javax.xml/src/main/java/org/w3c/dom/Document.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2011 Sonatype Inc. 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:
+ * Sonatype Inc. - initial API and implementation
+ *******************************************************************************/
+package org.w3c.dom;
+
+/**
+ * Dummy class used by Tycho ITs
+ */
+public class Document
+{
+
+}
View
23 ...es/org.eclipse.tycho.p2.resolver.impl.test/resources/repositories/javax.xml/artifacts.xml
@@ -0,0 +1,23 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?artifactRepository version='1.1.0'?>
+<repository name='dom' type='org.eclipse.equinox.p2.artifact.repository.simpleRepository' version='1'>
+ <properties size='2'>
+ <property name='p2.compressed' value='false'/>
+ <property name='p2.timestamp' value='1321674068470'/>
+ </properties>
+ <mappings size='3'>
+ <rule filter='(&amp; (classifier=osgi.bundle))' output='${repoUrl}/plugins/${id}_${version}.jar'/>
+ <rule filter='(&amp; (classifier=binary))' output='${repoUrl}/binary/${id}_${version}'/>
+ <rule filter='(&amp; (classifier=org.eclipse.update.feature))' output='${repoUrl}/features/${id}_${version}.jar'/>
+ </mappings>
+ <artifacts size='1'>
+ <artifact classifier='osgi.bundle' id='javax.xml' version='0.0.1.SNAPSHOT'>
+ <properties size='4'>
+ <property name='artifact.size' value='2528'/>
+ <property name='download.size' value='2528'/>
+ <property name='download.md5' value='f07a3e074825e0f56834d588e748dae4'/>
+ <property name='download.contentType' value='application/zip'/>
+ </properties>
+ </artifact>
+ </artifacts>
+</repository>
View
219 ...dles/org.eclipse.tycho.p2.resolver.impl.test/resources/repositories/javax.xml/content.xml
@@ -0,0 +1,219 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?metadataRepository version='1.1.0'?>
+<repository name='dom' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1'>
+ <properties size='2'>
+ <property name='p2.compressed' value='false'/>
+ <property name='p2.timestamp' value='1321674068477'/>
+ </properties>
+ <units size='3'>
+ <unit id='javax.xml' version='0.0.1.SNAPSHOT' singleton='false'>
+ <update id='javax.xml' range='[0.0.0,0.0.1.SNAPSHOT)' severity='0'/>
+ <properties size='1'>
+ <property name='org.eclipse.equinox.p2.name' value='javax.xml'/>
+ </properties>
+ <provides size='4'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='javax.xml' version='0.0.1.SNAPSHOT'/>
+ <provided namespace='osgi.bundle' name='javax.xml' version='0.0.1.SNAPSHOT'/>
+ <provided namespace='java.package' name='org.w3c.dom' version='0.0.1.SNAPSHOT'/>
+ <provided namespace='org.eclipse.equinox.p2.eclipse.type' name='bundle' version='1.0.0'/>
+ </provides>
+ <artifacts size='1'>
+ <artifact classifier='osgi.bundle' id='javax.xml' version='0.0.1.SNAPSHOT'/>
+ </artifacts>
+ <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
+ <touchpointData size='1'>
+ <instructions size='1'>
+ <instruction key='manifest'>
+ Bundle-ManifestVersion: 2&#xA;Built-By: igor&#xA;Bundle-Name: javax.xml&#xA;Manifest-Version: 1&#xA;Build-Jdk: 1.6.0_29&#xA;Bundle-SymbolicName: javax.xml&#xA;Tool: Bnd-1.43.0&#xA;Bundle-Version: 0.0.1.SNAPSHOT&#xA;Created-By: Apache Maven Bundle Plugin&#xA;Export-Package: org.w3c.dom;version=&quot;0.0.1.SNAPSHOT&quot;&#xA;Bnd-LastModified: 1321674015588&#xA;
+ </instruction>
+ </instructions>
+ </touchpointData>
+ </unit>
+ <unit id='config.a.jre' version='1.6.0' singleton='false'>
+ <hostRequirements size='1'>
+ <required namespace='org.eclipse.equinox.p2.iu' name='a.jre' range='1.6.0'/>
+ </hostRequirements>
+ <properties size='1'>
+ <property name='org.eclipse.equinox.p2.type.fragment' value='true'/>
+ </properties>
+ <provides size='1'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='config.a.jre' version='1.6.0'/>
+ </provides>
+ <requires size='1'>
+ <required namespace='org.eclipse.equinox.p2.iu' name='a.jre' range='1.6.0'/>
+ </requires>
+ <touchpoint id='org.eclipse.equinox.p2.native' version='1.0.0'/>
+ <touchpointData size='1'>
+ <instructions size='1'>
+ <instruction key='install'>
+
+ </instruction>
+ </instructions>
+ </touchpointData>
+ </unit>
+ <unit id='a.jre' version='1.6.0' singleton='false'>
+ <provides size='159'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='a.jre' version='1.6.0'/>
+ <provided namespace='java.package' name='javax.accessibility' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.activation' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.activity' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.annotation' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.annotation.processing' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.crypto' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.crypto.interfaces' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.crypto.spec' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.imageio' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.imageio.event' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.imageio.metadata' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.imageio.plugins.bmp' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.imageio.plugins.jpeg' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.imageio.spi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.imageio.stream' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.jws' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.jws.soap' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.lang.model' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.lang.model.element' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.lang.model.type' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.lang.model.util' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management.loading' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management.modelmbean' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management.monitor' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management.openmbean' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management.relation' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management.remote' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management.remote.rmi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management.timer' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.naming' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.naming.directory' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.naming.event' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.naming.ldap' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.naming.spi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.net' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.net.ssl' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.print' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.print.attribute' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.print.attribute.standard' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.print.event' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.rmi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.rmi.CORBA' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.rmi.ssl' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.script' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.security.auth' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.security.auth.callback' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.security.auth.kerberos' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.security.auth.login' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.security.auth.spi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.security.auth.x500' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.security.cert' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.security.sasl' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.sound.midi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.sound.midi.spi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.sound.sampled' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.sound.sampled.spi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.sql' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.sql.rowset' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.sql.rowset.serial' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.sql.rowset.spi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.border' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.colorchooser' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.event' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.filechooser' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.plaf' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.plaf.basic' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.plaf.metal' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.plaf.multi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.plaf.synth' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.table' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.text' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.text.html' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.text.html.parser' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.text.rtf' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.tree' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.undo' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.tools' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.transaction' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.transaction.xa' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.bind' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.bind.annotation' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.bind.annotation.adapters' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.bind.attachment' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.bind.helpers' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.bind.util' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.crypto' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.crypto.dom' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.crypto.dsig' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.crypto.dsig.dom' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.crypto.dsig.keyinfo' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.crypto.dsig.spec' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.datatype' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.namespace' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.parsers' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.soap' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.stream' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.stream.events' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.stream.util' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.transform' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.transform.dom' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.transform.sax' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.transform.stax' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.transform.stream' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.validation' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.ws' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.ws.handler' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.ws.handler.soap' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.ws.http' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.ws.soap' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.ws.spi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.ws.wsaddressing' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.xpath' version='0.0.0'/>
+ <provided namespace='java.package' name='org.ietf.jgss' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CORBA' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CORBA_2_3' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CORBA_2_3.portable' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CORBA.DynAnyPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CORBA.ORBPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CORBA.portable' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CORBA.TypeCodePackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CosNaming' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CosNaming.NamingContextExtPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CosNaming.NamingContextPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.Dynamic' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.DynamicAny' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.DynamicAny.DynAnyFactoryPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.DynamicAny.DynAnyPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.IOP' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.IOP.CodecFactoryPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.IOP.CodecPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.Messaging' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.PortableInterceptor' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.PortableInterceptor.ORBInitInfoPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.PortableServer' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.PortableServer.CurrentPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.PortableServer.POAManagerPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.PortableServer.POAPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.PortableServer.portable' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.PortableServer.ServantLocatorPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.SendingContext' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.stub.java.rmi' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom.bootstrap' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom.css' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom.events' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom.html' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom.ls' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom.ranges' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom.stylesheets' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom.traversal' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom.views' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom.xpath' version='0.0.0'/>
+ <provided namespace='java.package' name='org.xml.sax' version='0.0.0'/>
+ <provided namespace='java.package' name='org.xml.sax.ext' version='0.0.0'/>
+ <provided namespace='java.package' name='org.xml.sax.helpers' version='0.0.0'/>
+ </provides>
+ <touchpoint id='org.eclipse.equinox.p2.native' version='1.0.0'/>
+ </unit>
+ </units>
+</repository>
View
BIN ....resolver.impl.test/resources/repositories/javax.xml/plugins/javax.xml_0.0.1.SNAPSHOT.jar
Binary file not shown.
View
0 tycho-bundles/org.eclipse.tycho.p2.resolver.impl.test/resources/repositories/p2.sh 100644 → 100755
File mode changed.
View
7 ...g.eclipse.tycho.p2.resolver.impl.test/resources/resolver/bundle.bree/META-INF/MANIFEST.MF
@@ -0,0 +1,7 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: bundle.bree
+Bundle-Version: 1.0.0
+Bundle-RequiredExecutionEnvironment: OSGi/Minimum-1.0,
+ J2SE-1.5
+Import-Package: org.w3c.dom
View
5 ...eclipse.tycho.p2.resolver.impl.test/resources/resolver/bundle.nobree/META-INF/MANIFEST.MF
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: bundle.nobree
+Bundle-Version: 1.0.0
+Import-Package: org.w3c.dom
View
6 ...ver.impl.test/src/test/java/org/eclipse/tycho/p2/impl/resolver/P2ResolverOfflineTest.java
@@ -42,7 +42,7 @@
@Before
public void initResolver() throws Exception {
P2ResolverFactoryImpl p2ResolverFactoryImpl = createP2ResolverFactory(false);
- context = p2ResolverFactoryImpl.createResolutionContext(DISABLE_MIRRORS);
+ context = p2ResolverFactoryImpl.createResolutionContext(null, DISABLE_MIRRORS);
impl = new P2ResolverImpl(new MavenLoggerStub());
}
@@ -84,7 +84,7 @@ public void offline() throws Exception {
// now go offline and resolve again
P2ResolverFactoryImpl p2ResolverFactory = new P2ResolverFactoryImpl();
p2ResolverFactory.setMavenContext(createMavenContext(true, new MavenLoggerStub()));
- context = p2ResolverFactory.createResolutionContext(DISABLE_MIRRORS);
+ context = p2ResolverFactory.createResolutionContext(null, DISABLE_MIRRORS);
List<P2ResolutionResult> results = resolveFromHttp(context, impl, servedUrl);
Assert.assertEquals(1, results.size());
@@ -100,7 +100,7 @@ public void offlineNoLocalCache() throws Exception {
boolean offline = true;
P2ResolverFactoryImpl p2ResolverFactory = createP2ResolverFactory(offline);
- context = p2ResolverFactory.createResolutionContext(DISABLE_MIRRORS);
+ context = p2ResolverFactory.createResolutionContext(null, DISABLE_MIRRORS);
try {
resolveFromHttp(context, impl, servedUrl);
View
64 ...2.resolver.impl.test/src/test/java/org/eclipse/tycho/p2/impl/resolver/P2ResolverTest.java
@@ -45,9 +45,10 @@ static File getLocalRepositoryLocation() throws IOException {
@Before
public void initDefaultResolver() throws Exception {
+ org.eclipse.equinox.internal.p2.core.helpers.Tracing.DEBUG_PLANNER_PROJECTOR = true;
MavenLogger logger = new MavenLoggerStub();
P2ResolverFactoryImpl p2ResolverFactory = createP2ResolverFactory(false);
- context = p2ResolverFactory.createResolutionContext(false);
+ context = p2ResolverFactory.createResolutionContext(null, false);
impl = new P2ResolverImpl(logger);
impl.setEnvironments(getEnvironments());
}
@@ -258,4 +259,65 @@ public void reactorVsExternal() throws Exception {
Assert.assertEquals("1.0.0.qualifier", entry.getVersion());
}
}
+
+ @Test
+ public void resolutionRestrictedEE() throws Exception {
+ P2ResolverFactoryImpl p2ResolverFactory = createP2ResolverFactory(false);
+ context = p2ResolverFactory.createResolutionContext("CDC-1.0/Foundation-1.0", false);
+
+ context.addP2Repository(resourceFile("repositories/javax.xml").toURI());
+
+ File bundle = resourceFile("resolver/bundle.bree");
+ String artifactId = "bundle.bree";
+ addReactorProject(bundle, TYPE_ECLIPSE_PLUGIN, artifactId);
+
+ List<P2ResolutionResult> results = impl.resolveProject(context, bundle);
+
+ Assert.assertEquals(1, results.size());
+ P2ResolutionResult result = results.get(0);
+
+ Assert.assertEquals(2, result.getArtifacts().size());
+
+ Assert.assertEquals(1, result.getNonReactorUnits().size());
+ assertContainsUnit("javax.xml", result.getNonReactorUnits());
+ }
+
+ @Test
+ public void resolutionEE() throws Exception {
+ P2ResolverFactoryImpl p2ResolverFactory = createP2ResolverFactory(false);
+ context = p2ResolverFactory.createResolutionContext("J2SE-1.5", false);
+
+ context.addP2Repository(resourceFile("repositories/javax.xml").toURI());
+
+ File bundle = resourceFile("resolver/bundle.bree");
+ String artifactId = "bundle.bree";
+ addReactorProject(bundle, TYPE_ECLIPSE_PLUGIN, artifactId);
+
+ List<P2ResolutionResult> results = impl.resolveProject(context, bundle);
+
+ Assert.assertEquals(1, results.size());
+ P2ResolutionResult result = results.get(0);
+
+ Assert.assertEquals(1, result.getArtifacts().size());
+
+ Assert.assertEquals(0, result.getNonReactorUnits().size());
+ }
+
+ @Test
+ public void resolutionNoEE() throws Exception {
+ context.addP2Repository(resourceFile("repositories/javax.xml").toURI());
+
+ File bundle = resourceFile("resolver/bundle.nobree");
+ String artifactId = "bundle.nobree";
+ addReactorProject(bundle, TYPE_ECLIPSE_PLUGIN, artifactId);
+
+ List<P2ResolutionResult> results = impl.resolveProject(context, bundle);
+
+ Assert.assertEquals(1, results.size());
+ P2ResolutionResult result = results.get(0);
+
+ Assert.assertEquals(1, result.getArtifacts().size());
+
+ Assert.assertEquals(0, result.getNonReactorUnits().size());
+ }
}
View
2 ...c/test/java/org/eclipse/tycho/p2/impl/resolver/ResolutionContextDisableP2MirrorsTest.java
@@ -54,7 +54,7 @@ private ResolutionContextImpl createResolutionContext(boolean disableP2Mirrors)
mavenContext.setLocalRepositoryRoot(localRepo);
mavenContext.setLogger(new MavenLoggerStub());
p2ResolverFactoryImpl.setMavenContext(mavenContext);
- ResolutionContextImpl context = p2ResolverFactoryImpl.createResolutionContext(disableP2Mirrors);
+ ResolutionContextImpl context = p2ResolverFactoryImpl.createResolutionContext(null, disableP2Mirrors);
return context;
}
View
4 ...resolver.impl/src/main/java/org/eclipse/tycho/p2/impl/resolver/P2ResolverFactoryImpl.java
@@ -27,9 +27,9 @@
private MavenContext mavenContext;
- public ResolutionContextImpl createResolutionContext(boolean disableP2Mirrors) {
+ public ResolutionContextImpl createResolutionContext(String bree, boolean disableP2Mirrors) {
IProvisioningAgent agent = getProvisioningAgent(mavenContext.getLocalRepositoryRoot(), mavenContext.isOffline());
- return new ResolutionContextImpl(agent, mavenContext, disableP2Mirrors);
+ return new ResolutionContextImpl(agent, mavenContext, bree, disableP2Mirrors);
}
public P2ResolverImpl createResolver() {
View
6 ...cho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/impl/resolver/P2ResolverImpl.java
@@ -79,8 +79,9 @@ public P2ResolutionResult collectProjectDependencies(ResolutionContext context,
public P2ResolutionResult resolveMetadata(ResolutionContext context, Map<String, String> properties) {
ProjectorResolutionStrategy strategy = new ProjectorResolutionStrategy(properties, logger);
- strategy.setAvailableInstallableUnits(((ResolutionContextImpl) context)
- .gatherAvailableInstallableUnits(monitor));
+ ResolutionContextImpl contextImpl = (ResolutionContextImpl) context;
+ strategy.setJREUIs(contextImpl.getJREIUs());
+ strategy.setAvailableInstallableUnits(contextImpl.gatherAvailableInstallableUnits(monitor));
strategy.setRootInstallableUnits(new HashSet<IInstallableUnit>());
strategy.setAdditionalRequirements(additionalRequirements);
@@ -95,6 +96,7 @@ protected P2ResolutionResult resolveProject(File projectLocation, ResolutionStra
context.assertNoDuplicateReactorUIs();
strategy.setAvailableInstallableUnits(context.gatherAvailableInstallableUnits(monitor));
+ strategy.setJREUIs(context.getJREIUs());
LinkedHashSet<IInstallableUnit> projectIUs = context.getReactorProjectIUs(projectLocation);
strategy.setRootInstallableUnits(projectIUs);
strategy.setAdditionalRequirements(additionalRequirements);
View
10 ...er.impl/src/main/java/org/eclipse/tycho/p2/impl/resolver/ProjectorResolutionStrategy.java
@@ -67,6 +67,10 @@ public ProjectorResolutionStrategy(Map<String, String> properties, MavenLogger l
Set<IInstallableUnit> extraIUs = createAdditionalRequirementsIU();
+ // force JRE UIs to be part of resolved state
+ Set<IInstallableUnit> rootIUs = new LinkedHashSet<IInstallableUnit>(this.rootIUs);
+ rootIUs.addAll(jreIUs);
+
Set<IInstallableUnit> rootWithExtraIUs = new LinkedHashSet<IInstallableUnit>();
rootWithExtraIUs.addAll(rootIUs);
rootWithExtraIUs.addAll(extraIUs);
@@ -91,7 +95,7 @@ public ProjectorResolutionStrategy(Map<String, String> properties, MavenLogger l
Projector projector = new Projector(slice, newSelectionContext, new HashSet<IInstallableUnit>(), false);
projector.encode(createMetaIU(rootIUs), extraIUs.toArray(IU_ARRAY) /* alreadyExistingRoots */,
- new QueryableArray(IU_ARRAY) /* installed IUs */, rootIUs /* newRoots */, monitor);
+ new QueryableArray(IU_ARRAY) /* installedIUs */, rootIUs /* newRoots */, monitor);
IStatus s = projector.invokeSolver(monitor);
if (s.getSeverity() == IStatus.ERROR) {
Set<Explanation> explanation = projector.getExplanation(monitor);
@@ -107,6 +111,9 @@ public ProjectorResolutionStrategy(Map<String, String> properties, MavenLogger l
}
Collection<IInstallableUnit> newState = projector.extractSolution();
+ // remove JRE IUs from resolved state
+ newState.removeAll(jreIUs);
+
fixSWT(newState, newSelectionContext, monitor);
if (logger.isExtendedDebugEnabled()) {
@@ -197,5 +204,4 @@ private IInstallableUnit createMetaIU(Set<IInstallableUnit> rootIUs) {
return result;
}
-
}
View
53 ...resolver.impl/src/main/java/org/eclipse/tycho/p2/impl/resolver/ResolutionContextImpl.java
@@ -96,13 +96,19 @@
private final boolean disableP2Mirrors;
+ /**
+ * Target execution environment profile name or null to use system default profile name.
+ */
+ private final String executionEnvironment;
+
/** maven local repository as P2 IArtifactRepository */
private final LocalArtifactRepository localRepository;
/** maven local repository as P2 IMetadataRepository */
private final LocalMetadataRepository localMetadataRepository;
- ResolutionContextImpl(IProvisioningAgent agent, MavenContext mavenContext, boolean disableP2Mirrors) {
+ ResolutionContextImpl(IProvisioningAgent agent, MavenContext mavenContext, String executionEnvironment,
+ boolean disableP2Mirrors) {
this.agent = agent;
this.logger = mavenContext.getLogger();
this.monitor = new LoggingProgressMonitor(logger);
@@ -128,6 +134,8 @@
this.disableP2Mirrors = disableP2Mirrors;
+ this.executionEnvironment = executionEnvironment;
+
this.bundlesPublisher = new ResolutionContextBundlePublisher(mavenContext.getLocalRepositoryRoot(), logger);
// setup p2 views of maven local repository
@@ -407,13 +415,13 @@ public void stop() {
// -------------------------------------------------------------------------
public IQueryable<IInstallableUnit> gatherAvailableInstallableUnits(IProgressMonitor monitor) {
- Set<IInstallableUnit> result = new LinkedHashSet<IInstallableUnit>();
+ Collection<IInstallableUnit> result = new LinkedHashSet<IInstallableUnit>();
for (TargetPlatformContent contentPart : content) {
- result.addAll(contentPart.getUnits());
+ filterJREUIs(result, contentPart.getUnits());
}
- result.addAll(mavenInstallableUnits.keySet());
+ filterJREUIs(result, mavenInstallableUnits.keySet());
SubMonitor sub = SubMonitor.convert(monitor, metadataRepositories.size() * 200);
for (IMetadataRepository repository : metadataRepositories) {
@@ -426,6 +434,10 @@ public void stop() {
continue;
}
+ if (isJREUI(iu)) {
+ continue;
+ }
+
if (!isReactorInstallableUnit(iu)) {
if (!reactorInstallableUnitIds.contains(iu.getId())) {
result.add(iu);
@@ -437,12 +449,30 @@ public void stop() {
}
}
}
- result.addAll(createJREIUs());
+ result.addAll(getJREIUs());
sub.done();
// this is a real shame
return new QueryableArray(result.toArray(new IInstallableUnit[result.size()]));
}
+ /**
+ * p2 repositories are polluted with useless a.jre/config.a.jre IUs. These IUs do not represent
+ * current/desired JRE and can expose resolver to packages that are not actually available.
+ */
+ private void filterJREUIs(Collection<IInstallableUnit> result, Collection<? extends IInstallableUnit> units) {
+ for (IInstallableUnit iu : units) {
+ if (isJREUI(iu)) {
+ continue;
+ }
+ result.add(iu);
+ }
+ }
+
+ private boolean isJREUI(IInstallableUnit iu) {
+ // See JREAction
@jsievers
jsievers added a line comment Nov 21, 2011

kinda magic...

at least add a reference to relevant p2 bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=346174

and add a debug log statement otherwise we will wonder one fine day why certain IUs seem to disappear.

@ifedorenko
ifedorenko added a line comment Nov 21, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ return iu.getId().startsWith("a.jre") || iu.getId().startsWith("config.a.jre");
+ }
+
public void warnAboutLocalIus(Collection<IInstallableUnit> usedIus) {
final Set<IInstallableUnit> localIUs = localMetadataRepository.query(QueryUtil.ALL_UNITS, null).toSet();
if (logger.isDebugEnabled()) {
@@ -469,14 +499,12 @@ private boolean isReactorInstallableUnit(IInstallableUnit iu) {
}
/**
- * these dummy IUs are needed to satisfy Import-Package requirements to packages provided by the
- * JDK.
+ * Return IUs that represent packages provided by target JRE
*/
- private Collection<IInstallableUnit> createJREIUs() {
+ public Collection<IInstallableUnit> getJREIUs() {
PublisherResult results = new PublisherResult();
- // TODO use the appropriate profile name
- new JREAction((String) null).perform(new PublisherInfo(), results, new NullProgressMonitor());
- return results.query(QueryUtil.ALL_UNITS, new NullProgressMonitor()).toSet();
+ new JREAction(executionEnvironment).perform(new PublisherInfo(), results, new NullProgressMonitor());
+ return results.query(QueryUtil.ALL_UNITS, new NullProgressMonitor()).toUnmodifiableSet();
}
// -------------------------------------------------------------------------------
@@ -514,7 +542,8 @@ public void downloadArtifacts(Collection<IInstallableUnit> newState) {
IStatus result = allArtifactRepositories.getArtifacts(requests.toArray(ARTIFACT_REQUEST_ARRAY), monitor);
if (!result.isOK()) {
- throw new RuntimeException(StatusTool.collectProblems(result), result.getException()); // TODO find root exception - the MultiStatus probably doesn't have one
+ // TODO find root exception - the MultiStatus probably doesn't have one
+ throw new RuntimeException(StatusTool.collectProblems(result), result.getException());
}
requests = filterCompletedRequests(requests);
View
6 ...p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/impl/resolver/ResolutionStrategy.java
@@ -22,6 +22,8 @@
public abstract class ResolutionStrategy {
protected IQueryable<IInstallableUnit> availableIUs;
+ protected Collection<IInstallableUnit> jreIUs;
+
protected Set<IInstallableUnit> rootIUs;
protected List<IRequirement> additionalRequirements;
@@ -38,5 +40,9 @@ public void setAdditionalRequirements(List<IRequirement> additionalRequirements)
this.additionalRequirements = additionalRequirements;
}
+ public void setJREUIs(Collection<IInstallableUnit> jreIUs) {
+ this.jreIUs = jreIUs;
+ }
+
public abstract Collection<IInstallableUnit> resolve(IProgressMonitor monitor);
}
View
4 ....p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetDefinitionResolver.java
@@ -55,6 +55,10 @@
import org.eclipse.tycho.p2.target.facade.TargetDefinitionSyntaxException;
import org.eclipse.tycho.p2.util.StatusTool;
+/**
+ * TODO respect target execution environment profile. Current implementation assumes current JRE and
+ * will select wrong installable units for restricted target profiles like OSGi/Minimum-1.0
+ */
public class TargetDefinitionResolver {
private static final IInstallableUnit[] EMPTY_IU_ARRAY = new IInstallableUnit[0];
View
79 tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java
@@ -20,14 +20,12 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Comparator;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
-import java.util.regex.Pattern;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
@@ -65,6 +63,7 @@
import org.eclipse.tycho.core.utils.ExecutionEnvironmentUtils;
import org.eclipse.tycho.core.utils.MavenArtifactRef;
import org.eclipse.tycho.runtime.Adaptable;
+import org.osgi.framework.Constants;
import copied.org.apache.maven.plugin.AbstractCompilerMojo;
import copied.org.apache.maven.plugin.CompilationFailureException;
@@ -84,8 +83,8 @@
public static final String RULE_EXCLUDE_ALL = "?**/*";
private static final Set<String> MATCH_ALL = Collections.singleton("**/*");
- private static final String MANIFEST_HEADER_BUNDLE_REQ_EXEC_ENV = "Bundle-RequiredExecutionEnvironment";
- private static final Pattern COMMA_SEP_INCLUDING_WHITESPACE = Pattern.compile("\\s*,\\s*");
+// private static final String MANIFEST_HEADER_BUNDLE_REQ_EXEC_ENV = "Bundle-RequiredExecutionEnvironment";
+// private static final Pattern COMMA_SEP_INCLUDING_WHITESPACE = Pattern.compile("\\s*,\\s*");
@jsievers
jsievers added a line comment Nov 21, 2011

why not delete these two lines?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
/**
* @parameter expression="${project}"
@@ -385,14 +384,14 @@ protected CompilerConfiguration getCompilerConfiguration(List<String> compileSou
private void configureBootclasspathAccessRules(CompilerConfiguration compilerConfiguration)
throws MojoExecutionException {
- ExecutionEnvironment environment = getMinimalCompilerTargetEnvironment();
+ ExecutionEnvironment environment = getTargetExecutionEnvironment();
if (environment != null) {
List<AccessRule> accessRules = new ArrayList<ClasspathEntry.AccessRule>();
accessRules.add(new DefaultAccessRule("java/**", false));
for (String pkg : environment.getSystemPackages()) {
- accessRules.add(new DefaultAccessRule(pkg.replace('.', '/') + "/*", false));
+ accessRules.add(new DefaultAccessRule(pkg.trim().replace('.', '/') + "/*", false));
}
compilerConfiguration
@@ -404,10 +403,10 @@ private void configureJavaHome(CompilerConfiguration compilerConfiguration) thro
if (useJDK != JDKUsage.BREE) {
return;
}
- ExecutionEnvironment environment = getMinimalCompilerTargetEnvironment();
+ ExecutionEnvironment environment = getTargetExecutionEnvironment();
if (environment == null) {
getLog().warn(
- "useJDK = BREE configured, but bundle has no " + MANIFEST_HEADER_BUNDLE_REQ_EXEC_ENV
+ "useJDK = BREE configured, but bundle has no " + Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT
+ " header. Compiling with current JDK.");
} else {
String javaHome = findMatchingJavaToolChain(environment).getJavaHome();
@@ -436,20 +435,9 @@ private DefaultJavaToolChain findMatchingJavaToolChain(final ExecutionEnvironmen
private void configureSourceAndTargetLevel(CompilerConfiguration compilerConfiguration)
throws MojoExecutionException {
- String[] executionEnvironments = getExecutionEnvironments();
- if (executionEnvironments.length == 0) {
- return;
- }
- compilerConfiguration.setSourceVersion(getSourceLevel(executionEnvironments));
- compilerConfiguration.setTargetVersion(getTargetLevel(executionEnvironments));
- }
-
- private String[] getExecutionEnvironments() throws MojoExecutionException {
- String requiredExecEnvs = getBundleProject().getManifestValue(MANIFEST_HEADER_BUNDLE_REQ_EXEC_ENV, project);
- if (requiredExecEnvs == null) {
- return new String[0];
- }
- return COMMA_SEP_INCLUDING_WHITESPACE.split(requiredExecEnvs.trim());
+ ExecutionEnvironment ee = getTargetExecutionEnvironment();
+ compilerConfiguration.setSourceVersion(getSourceLevel(ee));
+ compilerConfiguration.setTargetVersion(getTargetLevel(ee));
}
private String getMinimalTargetVersion(String[] executionEnvironments) throws UnknownEnvironmentException {
@@ -466,24 +454,8 @@ private String getMinimalTargetVersion(String[] executionEnvironments) throws Un
return Collections.min(targetLevels);
}
- private ExecutionEnvironment getMinimalCompilerTargetEnvironment() throws MojoExecutionException {
- List<ExecutionEnvironment> environments = new ArrayList<ExecutionEnvironment>();
- for (String env : getExecutionEnvironments()) {
- try {
- environments.add(ExecutionEnvironmentUtils.getExecutionEnvironment(env));
- } catch (UnknownEnvironmentException e) {
- throw new MojoExecutionException(e.getMessage(), e);
- }
- }
- if (environments.isEmpty()) {
- return null;
- }
- return Collections.min(environments, new Comparator<ExecutionEnvironment>() {
-
- public int compare(ExecutionEnvironment env1, ExecutionEnvironment env2) {
- return env1.getCompilerTargetLevel().compareTo(env2.getCompilerTargetLevel());
- }
- });
+ private ExecutionEnvironment getTargetExecutionEnvironment() throws MojoExecutionException {
+ return getBundleProject().getExecutionEnvironment(project);
}
private String getMinimalSourceVersion(String[] executionEnvironments) throws UnknownEnvironmentException {
@@ -541,44 +513,35 @@ private String getMinimalSourceVersion(String[] executionEnvironments) throws Un
}
public String getExecutionEnvironment() throws MojoExecutionException {
- String[] environments = getExecutionEnvironments();
- return environments != null && environments.length > 0 ? environments[0] : null;
+ return getTargetExecutionEnvironment().getProfileName();
}
public String getSourceLevel() throws MojoExecutionException {
- return getSourceLevel(getExecutionEnvironments());
+ return getSourceLevel(getTargetExecutionEnvironment());
}
- private String getSourceLevel(String[] executionEnvironments) {
+ private String getSourceLevel(ExecutionEnvironment env) {
if (source != null) {
// explicit pom configuration wins
return source;
}
- if (executionEnvironments != null && executionEnvironments.length > 0) {
- try {
- return getMinimalSourceVersion(executionEnvironments);
- } catch (UnknownEnvironmentException e) {
- // fall through
- }
+ if (env != null) {
+ return env.getCompilerSourceLevel();
}
return DEFAULT_SOURCE_VERSION;
}
public String getTargetLevel() throws MojoExecutionException {
- return getTargetLevel(getExecutionEnvironments());
+ return getTargetLevel(getTargetExecutionEnvironment());
}
- public String getTargetLevel(String[] executionEnvironments) {
+ public String getTargetLevel(ExecutionEnvironment env) {
if (target != null) {
// explicit pom configuration wins
return target;
}
- if (executionEnvironments != null && executionEnvironments.length > 0) {
- try {
- return getMinimalTargetVersion(executionEnvironments);
- } catch (UnknownEnvironmentException e) {
- // fall through
- }
+ if (env != null) {
+ return env.getCompilerTargetLevel();
}
return DEFAULT_TARGET_VERSION;
}
View
11 ...o-compiler-plugin/src/test/java/org/eclipse/tycho/osgicompiler/test/OsgiCompilerTest.java
@@ -231,21 +231,28 @@ public void testExecutionEnvironment() throws Exception {
// project with multiple execution envs.
// Minimum source and target level must be taken
project = projects.get(2);
+ AbstractOsgiCompilerMojo mojo = getMojo(projects, project);
+ assertEquals("OSGi/Minimum-1.0", mojo.getExecutionEnvironment());
try {
- getMojo(projects, project).execute();
+ mojo.execute();
fail("compilation failure due to assert keyword expected");
} catch (CompilationFailureException e) {
// expected
}
// project with both explicit compiler configuration in pom.xml and Bundle-RequiredExecutionEnvironment.
// explicit compiler configuration in the pom should win. see https://issues.sonatype.org/browse/TYCHO-476
project = projects.get(3);
- AbstractOsgiCompilerMojo mojo = getMojo(projects, project);
+ mojo = getMojo(projects, project);
assertEquals("jsr14", mojo.getTargetLevel());
assertEquals("1.5", mojo.getSourceLevel());
assertEquals("J2SE-1.5", mojo.getExecutionEnvironment());
mojo.execute();
assertBytecodeMajorLevel(TARGET_1_4, new File(project.getBasedir(), "target/classes/Generic.class"));
+ // project with both explicit EE configuration in pom.xml and Bundle-RequiredExecutionEnvironment.
+ // explicit configuration in the pom.xml win
+ project = projects.get(4);
+ mojo = getMojo(projects, project);
+ assertEquals("J2SE-1.5", mojo.getExecutionEnvironment());
}
private void assertBytecodeMajorLevel(int majorLevel, File classFile) throws ClassFormatException, IOException {
View
6 ...ompiler-plugin/src/test/resources/projects/executionEnvironment/p004/META-INF/MANIFEST.MF
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: P004
+Bundle-SymbolicName: p004
+Bundle-Version: 1.0.0
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,OSGi/Minimum-1.2
View
4 tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p004/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
View
35 tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p004/pom.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <parent>
+ <artifactId>projects</artifactId>
+ <groupId>executionEnvironment</groupId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>executionEnvironments</groupId>
+ <artifactId>p004</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <version>1.0.0</version>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-compiler-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <compilerId>jdt</compilerId>
+ <usePdeSourceRoots>true</usePdeSourceRoots>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <executionEnvironment>J2SE-1.5</executionEnvironment>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
View
0 tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p004/src/.gitignore
No changes.
View
1 tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/pom.xml
@@ -8,5 +8,6 @@
<module>p001</module>
<module>p002</module>
<module>p003</module>
+ <module>p004</module>
</modules>
</project>
View
10 tycho-core/src/main/java/org/eclipse/tycho/core/TargetPlatformConfiguration.java
@@ -36,6 +36,8 @@
private boolean disableP2Mirrors;
+ private String executionEnvironment;
+
/**
* Returns the list of configured target environments, or the running environment if no
* environments have been specified explicitly.
@@ -105,4 +107,12 @@ public void addExtraRequirement(Dependency requirement) {
public List<Dependency> getExtraRequirements() {
return extraRequirements;
}
+
+ public String getExecutionEnvironment() {
+ return executionEnvironment;
+ }
+
+ public void setExecutionEnvironment(String executionEnvironment) {
+ this.executionEnvironment = executionEnvironment;
+ }
}
View
6 tycho-core/src/main/java/org/eclipse/tycho/core/TychoProject.java
@@ -13,6 +13,7 @@
import org.apache.maven.project.MavenProject;
import org.eclipse.tycho.ArtifactKey;
import org.eclipse.tycho.ReactorProject;
+import org.eclipse.tycho.core.utils.ExecutionEnvironment;
/**
* tycho-specific behaviour associated with MavenProject instances. stateless.
@@ -49,4 +50,9 @@
* Eclipse-PlatformFilter OSGi bundle manifest attribute.
*/
public TargetEnvironment getImplicitTargetEnvironment(MavenProject project);
+
+ /**
+ * Project target execution environment used during the build or null.
+ */
+ public ExecutionEnvironment getExecutionEnvironment(MavenProject project);
}
View
17 tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/AbstractTychoProject.java
@@ -20,8 +20,11 @@
import org.eclipse.tycho.core.TargetPlatformConfiguration;
import org.eclipse.tycho.core.TychoConstants;
import org.eclipse.tycho.core.TychoProject;
+import org.eclipse.tycho.core.UnknownEnvironmentException;
import org.eclipse.tycho.core.osgitools.targetplatform.LocalTargetPlatformResolver;
import org.eclipse.tycho.core.osgitools.targetplatform.MultiEnvironmentTargetPlatform;
+import org.eclipse.tycho.core.utils.ExecutionEnvironment;
+import org.eclipse.tycho.core.utils.ExecutionEnvironmentUtils;
import org.eclipse.tycho.core.utils.TychoProjectUtils;
public abstract class AbstractTychoProject extends AbstractLogEnabled implements TychoProject {
@@ -83,4 +86,18 @@ public void resolveClassPath(MavenSession session, MavenProject project) {
public TargetEnvironment getImplicitTargetEnvironment(MavenProject project) {
return null;
}
+
+ public ExecutionEnvironment getExecutionEnvironment(MavenProject project) {
+ String ee = TychoProjectUtils.getTargetPlatformConfiguration(project).getExecutionEnvironment();
+
+ if (ee != null) {
+ try {
+ return ExecutionEnvironmentUtils.getExecutionEnvironment(ee);
+ } catch (UnknownEnvironmentException e) {
+ // can't happen, ee is validated during configuration parsing
+ }
+ }
+
+ return null;
+ }
}
View
4 tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EquinoxResolver.java
@@ -38,6 +38,7 @@
import org.eclipse.tycho.core.TychoConstants;
import org.eclipse.tycho.core.utils.ExecutionEnvironmentUtils;
import org.eclipse.tycho.core.utils.PlatformPropertiesUtils;
+import org.eclipse.tycho.core.utils.TychoProjectUtils;
import org.osgi.framework.BundleException;
@Component(role = EquinoxResolver.class)
@@ -101,8 +102,7 @@ public String toDebugString(State state) {
}
protected Properties getPlatformProperties(MavenProject project) {
- TargetPlatformConfiguration configuration = (TargetPlatformConfiguration) project
- .getContextValue(TychoConstants.CTX_TARGET_PLATFORM_CONFIGURATION);
+ TargetPlatformConfiguration configuration = TychoProjectUtils.getTargetPlatformConfiguration(project);
TargetEnvironment environment = configuration.getEnvironments().get(0);
Properties properties = new Properties();
View
50 tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java
@@ -15,6 +15,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
@@ -31,6 +32,7 @@
import org.eclipse.osgi.framework.internal.core.FilterImpl;
import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.osgi.service.resolver.State;
+import org.eclipse.osgi.util.ManifestElement;
import org.eclipse.tycho.ArtifactDescriptor;
import org.eclipse.tycho.ArtifactKey;
import org.eclipse.tycho.ReactorProject;
@@ -43,10 +45,13 @@
import org.eclipse.tycho.core.TargetPlatform;
import org.eclipse.tycho.core.TychoConstants;
import org.eclipse.tycho.core.TychoProject;
+import org.eclipse.tycho.core.UnknownEnvironmentException;
import org.eclipse.tycho.core.osgitools.DependencyComputer.DependencyEntry;
import org.eclipse.tycho.core.osgitools.project.BuildOutputJar;
import org.eclipse.tycho.core.osgitools.project.EclipsePluginProject;
import org.eclipse.tycho.core.osgitools.project.EclipsePluginProjectImpl;
+import org.eclipse.tycho.core.utils.ExecutionEnvironment;
+import org.eclipse.tycho.core.utils.ExecutionEnvironmentUtils;
import org.eclipse.tycho.core.utils.PlatformPropertiesUtils;
import org.eclipse.tycho.model.Feature;
import org.eclipse.tycho.model.ProductConfiguration;
@@ -417,4 +422,49 @@ private static String sn(String str) {
}
return null;
}
+
+ public ExecutionEnvironment getExecutionEnvironment(MavenProject project) {
+ ExecutionEnvironment explicitEE = super.getExecutionEnvironment(project);
+
+ if (explicitEE != null) {
+ // explicitly configured environment wins
+ return explicitEE;
+ }
+
+ try {
+ // PDE compatibility (I really feel generous today)
+ String ee = getEclipsePluginProject(DefaultReactorProject.adapt(project)).getBuildProperties().getProperty(
+ "jre.compilation.profile");
+ if (ee != null) {
+ return ExecutionEnvironmentUtils.getExecutionEnvironment(ee);
+ }
+
+ String requiredExecEnvs = getManifestValue(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, project);
+ if (requiredExecEnvs == null) {
+ return null;
+ }
+
+ List<ExecutionEnvironment> environments = new ArrayList<ExecutionEnvironment>();
+ ManifestElement[] elements = ManifestElement.parseHeader(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT,
+ requiredExecEnvs);
+ for (ManifestElement element : elements) {
+ environments.add(ExecutionEnvironmentUtils.getExecutionEnvironment(element.getValue()));
+ }
+ if (environments.isEmpty()) {
+ return null;
+ }
+ return Collections.min(environments, new Comparator<ExecutionEnvironment>() {
+ public int compare(ExecutionEnvironment env1, ExecutionEnvironment env2) {
+ // TODO compare using org.osgi.framework.executionenvironment profile property
+ return env1.getCompilerTargetLevel().compareTo(env2.getCompilerTargetLevel());
@jsievers
jsievers added a line comment Nov 21, 2011

I think the minimum EE depends on what you are looking at (source or target level)
The method name getExecutionEnvironment() does not give a hint that it's actually the minimum target level.

I had thought about using a Comparator with org.osgi.framework.executionenvironment.
The problem here is that not all profiles can be compared to each other, e.g. OSGi/Minimum * and CDC * do not compare to JavaSE/J2SE/JRE *

@ifedorenko
ifedorenko added a line comment Nov 21, 2011

List of supported profiles is more or less static, so we can just hardcode specific order here. What do you think?

@jsievers
jsievers added a line comment Nov 21, 2011

give me a minute and I will push a ExecutionEnvironment comparator based on

org.osgi.framework.system.capabilities

@ifedorenko
ifedorenko added a line comment Nov 21, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ }
+ });
+ } catch (BundleException e) {
+ // TODO log or throw exception
@jsievers
jsievers added a line comment Nov 21, 2011

why not log or throw it then?

@ifedorenko
ifedorenko added a line comment Nov 21, 2011

Because I could not decide between the two :-) Do you have any preferences?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ } catch (UnknownEnvironmentException e) {
+ // TODO log or throw exception
+ }
+
+ return null;
+ }
}
View
21 ...c/main/java/org/eclipse/tycho/core/resolver/DefaultTargetPlatformConfigurationReader.java
@@ -29,6 +29,8 @@
import org.eclipse.tycho.core.TargetPlatformConfiguration;
import org.eclipse.tycho.core.TychoConstants;
import org.eclipse.tycho.core.TychoProject;
+import org.eclipse.tycho.core.UnknownEnvironmentException;
+import org.eclipse.tycho.core.utils.ExecutionEnvironmentUtils;
import org.eclipse.tycho.core.utils.PlatformPropertiesUtils;
@Component(role = DefaultTargetPlatformConfigurationReader.class)
@@ -69,6 +71,8 @@ public TargetPlatformConfiguration getTargetPlatformConfiguration(MavenSession s
setAllowConflictingDependencies(result, configuration);
setDisableP2Mirrors(result, configuration);
+
+ setExecutionEnvironment(result, configuration);
}
}
@@ -108,6 +112,23 @@ public TargetPlatformConfiguration getTargetPlatformConfiguration(MavenSession s
return result;
}
+ private void setExecutionEnvironment(TargetPlatformConfiguration result, Xpp3Dom configuration) {
+ Xpp3Dom eeDom = configuration.getChild("executionEnvironment");
+ if (eeDom == null) {
+ return;
+ }
+ String ee = eeDom.getValue().trim();
+ if (!"".equals(ee)) {
+ try {
+ ExecutionEnvironmentUtils.getExecutionEnvironment(ee);
+ } catch (UnknownEnvironmentException e) {
+ throw new RuntimeException("Invalid execution environment profile name " + ee);
+ }
+
+ result.setExecutionEnvironment(ee);
+ }
+ }
+
private void addExtraRequirements(TargetPlatformConfiguration result, Xpp3Dom configuration) {
Xpp3Dom requirementsDom = configuration.getChild("extraRequirements");
if (requirementsDom == null) {
View
4 ...e/src/main/java/org/eclipse/tycho/core/resolver/DefaultTargetPlatformResolverFactory.java
@@ -24,6 +24,7 @@
import org.eclipse.tycho.core.TargetPlatformResolver;
import org.eclipse.tycho.core.TychoConstants;
import org.eclipse.tycho.core.osgitools.targetplatform.LocalTargetPlatformResolver;
+import org.eclipse.tycho.core.utils.TychoProjectUtils;
@Component(role = DefaultTargetPlatformResolverFactory.class)
public class DefaultTargetPlatformResolverFactory {
@@ -37,8 +38,7 @@
public TargetPlatformResolver lookupPlatformResolver(MavenProject project) {
Properties properties = (Properties) project.getContextValue(TychoConstants.CTX_MERGED_PROPERTIES);
- TargetPlatformConfiguration configuration = (TargetPlatformConfiguration) project
- .getContextValue(TychoConstants.CTX_TARGET_PLATFORM_CONFIGURATION);
+ TargetPlatformConfiguration configuration = TychoProjectUtils.getTargetPlatformConfiguration(project);
String property = properties.getProperty("tycho.targetPlatform");
TargetPlatformResolver resolver;
View
7 tycho-its/projects/364095_dependencyResolverBREE/ee-from-bree/META-INF/MANIFEST.MF
@@ -0,0 +1,7 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: 364095_dependencyResolverBREE.ee-from-bree
+Bundle-Version: 1.0.0
+Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0,
+ J2SE-1.5
+Import-Package: org.w3c.dom
View
4 tycho-its/projects/364095_dependencyResolverBREE/ee-from-bree/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
View
33 tycho-its/projects/364095_dependencyResolverBREE/ee-from-bree/pom.xml
@@ -0,0 +1,33 @@
+<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>364095_dependencyResolverBREE.ee-from-bree</artifactId>
+ <version>1.0.0</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <properties>
+ <tycho-version>0.13.0</tycho-version>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>javax.xml</id>
+ <layout>p2</layout>
+ <url>${javax.xml-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>
View
7 tycho-its/projects/364095_dependencyResolverBREE/ee-from-bree/src/test/w3c/TestW3C.java
@@ -0,0 +1,7 @@
+package test.w3c;
+
+import org.w3c.dom.Document;
+
+public class TestW3C {
+ Document doc;
+}
View
5 tycho-its/projects/364095_dependencyResolverBREE/ee-from-jre/META-INF/MANIFEST.MF
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: 364095_dependencyResolverBREE.ee-from-jre
+Bundle-Version: 1.0.0
+Import-Package: org.w3c.dom
View
4 tycho-its/projects/364095_dependencyResolverBREE/ee-from-jre/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
View
25 tycho-its/projects/364095_dependencyResolverBREE/ee-from-jre/pom.xml
@@ -0,0 +1,25 @@
+<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>364095_dependencyResolverBREE.ee-from-jre</artifactId>
+ <version>1.0.0</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <properties>
+ <tycho-version>0.13.0</tycho-version>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
View
7 tycho-its/projects/364095_dependencyResolverBREE/ee-from-jre/src/test/w3c/TestW3C.java
@@ -0,0 +1,7 @@
+package test.w3c;
+
+import org.w3c.dom.Document;
+
+public class TestW3C {
+ Document doc;
+}
View
7 tycho-its/projects/364095_dependencyResolverBREE/ee-from-pom/META-INF/MANIFEST.MF
@@ -0,0 +1,7 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: 364095_dependencyResolverBREE.ee-from-pom
+Bundle-Version: 1.0.0
+Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0,
+ J2SE-1.5
+Import-Package: org.w3c.dom
View
4 tycho-its/projects/364095_dependencyResolverBREE/ee-from-pom/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
View
33 tycho-its/projects/364095_dependencyResolverBREE/ee-from-pom/pom.xml
@@ -0,0 +1,33 @@
+<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>364095_dependencyResolverBREE.ee-from-pom</artifactId>
+ <version>1.0.0</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <properties>
+ <tycho-version>0.13.0</tycho-version>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <extensions>true</extensions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <executionEnvironment>J2SE-1.5</executionEnvironment>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
View
7 tycho-its/projects/364095_dependencyResolverBREE/ee-from-pom/src/test/w3c/TestW3C.java
@@ -0,0 +1,7 @@
+package test.w3c;
+
+import org.w3c.dom.Document;
+
+public class TestW3C {
+ Document doc;
+}
View
23 tycho-its/repositories/javax.xml/artifacts.xml
@@ -0,0 +1,23 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?artifactRepository version='1.1.0'?>
+<repository name='dom' type='org.eclipse.equinox.p2.artifact.repository.simpleRepository' version='1'>
+ <properties size='2'>
+ <property name='p2.compressed' value='false'/>
+ <property name='p2.timestamp' value='1321674068470'/>
+ </properties>
+ <mappings size='3'>
+ <rule filter='(&amp; (classifier=osgi.bundle))' output='${repoUrl}/plugins/${id}_${version}.jar'/>
+ <rule filter='(&amp; (classifier=binary))' output='${repoUrl}/binary/${id}_${version}'/>
+ <rule filter='(&amp; (classifier=org.eclipse.update.feature))' output='${repoUrl}/features/${id}_${version}.jar'/>
+ </mappings>
+ <artifacts size='1'>
+ <artifact classifier='osgi.bundle' id='javax.xml' version='0.0.1.SNAPSHOT'>
+ <properties size='4'>
+ <property name='artifact.size' value='2528'/>
+ <property name='download.size' value='2528'/>
+ <property name='download.md5' value='f07a3e074825e0f56834d588e748dae4'/>
+ <property name='download.contentType' value='application/zip'/>
+ </properties>
+ </artifact>
+ </artifacts>
+</repository>
View
219 tycho-its/repositories/javax.xml/content.xml
@@ -0,0 +1,219 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?metadataRepository version='1.1.0'?>
+<repository name='dom' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1'>
+ <properties size='2'>
+ <property name='p2.compressed' value='false'/>
+ <property name='p2.timestamp' value='1321674068477'/>
+ </properties>
+ <units size='3'>
+ <unit id='javax.xml' version='0.0.1.SNAPSHOT' singleton='false'>
+ <update id='javax.xml' range='[0.0.0,0.0.1.SNAPSHOT)' severity='0'/>
+ <properties size='1'>
+ <property name='org.eclipse.equinox.p2.name' value='javax.xml'/>
+ </properties>
+ <provides size='4'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='javax.xml' version='0.0.1.SNAPSHOT'/>
+ <provided namespace='osgi.bundle' name='javax.xml' version='0.0.1.SNAPSHOT'/>
+ <provided namespace='java.package' name='org.w3c.dom' version='0.0.1.SNAPSHOT'/>
+ <provided namespace='org.eclipse.equinox.p2.eclipse.type' name='bundle' version='1.0.0'/>
+ </provides>
+ <artifacts size='1'>
+ <artifact classifier='osgi.bundle' id='javax.xml' version='0.0.1.SNAPSHOT'/>
+ </artifacts>
+ <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
+ <touchpointData size='1'>
+ <instructions size='1'>
+ <instruction key='manifest'>
+ Bundle-ManifestVersion: 2&#xA;Built-By: igor&#xA;Bundle-Name: javax.xml&#xA;Manifest-Version: 1&#xA;Build-Jdk: 1.6.0_29&#xA;Bundle-SymbolicName: javax.xml&#xA;Tool: Bnd-1.43.0&#xA;Bundle-Version: 0.0.1.SNAPSHOT&#xA;Created-By: Apache Maven Bundle Plugin&#xA;Export-Package: org.w3c.dom;version=&quot;0.0.1.SNAPSHOT&quot;&#xA;Bnd-LastModified: 1321674015588&#xA;
+ </instruction>
+ </instructions>
+ </touchpointData>
+ </unit>
+ <unit id='config.a.jre' version='1.6.0' singleton='false'>
+ <hostRequirements size='1'>
+ <required namespace='org.eclipse.equinox.p2.iu' name='a.jre' range='1.6.0'/>
+ </hostRequirements>
+ <properties size='1'>
+ <property name='org.eclipse.equinox.p2.type.fragment' value='true'/>
+ </properties>
+ <provides size='1'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='config.a.jre' version='1.6.0'/>
+ </provides>
+ <requires size='1'>
+ <required namespace='org.eclipse.equinox.p2.iu' name='a.jre' range='1.6.0'/>
+ </requires>
+ <touchpoint id='org.eclipse.equinox.p2.native' version='1.0.0'/>
+ <touchpointData size='1'>
+ <instructions size='1'>
+ <instruction key='install'>
+
+ </instruction>
+ </instructions>
+ </touchpointData>
+ </unit>
+ <unit id='a.jre' version='1.6.0' singleton='false'>
+ <provides size='159'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='a.jre' version='1.6.0'/>
+ <provided namespace='java.package' name='javax.accessibility' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.activation' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.activity' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.annotation' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.annotation.processing' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.crypto' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.crypto.interfaces' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.crypto.spec' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.imageio' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.imageio.event' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.imageio.metadata' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.imageio.plugins.bmp' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.imageio.plugins.jpeg' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.imageio.spi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.imageio.stream' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.jws' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.jws.soap' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.lang.model' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.lang.model.element' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.lang.model.type' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.lang.model.util' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management.loading' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management.modelmbean' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management.monitor' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management.openmbean' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management.relation' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management.remote' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management.remote.rmi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.management.timer' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.naming' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.naming.directory' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.naming.event' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.naming.ldap' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.naming.spi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.net' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.net.ssl' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.print' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.print.attribute' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.print.attribute.standard' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.print.event' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.rmi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.rmi.CORBA' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.rmi.ssl' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.script' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.security.auth' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.security.auth.callback' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.security.auth.kerberos' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.security.auth.login' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.security.auth.spi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.security.auth.x500' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.security.cert' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.security.sasl' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.sound.midi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.sound.midi.spi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.sound.sampled' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.sound.sampled.spi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.sql' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.sql.rowset' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.sql.rowset.serial' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.sql.rowset.spi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.border' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.colorchooser' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.event' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.filechooser' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.plaf' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.plaf.basic' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.plaf.metal' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.plaf.multi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.plaf.synth' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.table' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.text' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.text.html' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.text.html.parser' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.text.rtf' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.tree' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.swing.undo' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.tools' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.transaction' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.transaction.xa' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.bind' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.bind.annotation' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.bind.annotation.adapters' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.bind.attachment' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.bind.helpers' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.bind.util' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.crypto' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.crypto.dom' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.crypto.dsig' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.crypto.dsig.dom' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.crypto.dsig.keyinfo' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.crypto.dsig.spec' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.datatype' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.namespace' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.parsers' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.soap' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.stream' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.stream.events' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.stream.util' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.transform' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.transform.dom' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.transform.sax' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.transform.stax' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.transform.stream' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.validation' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.ws' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.ws.handler' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.ws.handler.soap' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.ws.http' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.ws.soap' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.ws.spi' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.ws.wsaddressing' version='0.0.0'/>
+ <provided namespace='java.package' name='javax.xml.xpath' version='0.0.0'/>
+ <provided namespace='java.package' name='org.ietf.jgss' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CORBA' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CORBA_2_3' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CORBA_2_3.portable' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CORBA.DynAnyPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CORBA.ORBPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CORBA.portable' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CORBA.TypeCodePackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CosNaming' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CosNaming.NamingContextExtPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.CosNaming.NamingContextPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.Dynamic' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.DynamicAny' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.DynamicAny.DynAnyFactoryPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.DynamicAny.DynAnyPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.IOP' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.IOP.CodecFactoryPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.IOP.CodecPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.Messaging' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.PortableInterceptor' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.PortableInterceptor.ORBInitInfoPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.PortableServer' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.PortableServer.CurrentPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.PortableServer.POAManagerPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.PortableServer.POAPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.PortableServer.portable' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.PortableServer.ServantLocatorPackage' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.SendingContext' version='0.0.0'/>
+ <provided namespace='java.package' name='org.omg.stub.java.rmi' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom.bootstrap' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom.css' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom.events' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom.html' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom.ls' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom.ranges' version='0.0.0'/>
+ <provided namespace='java.package' name='org.w3c.dom.stylesheets' version='0.0.0'/>
+ <provided namespac