Dear List,
I am brand-new to Maven, Tycho and Felix.
I'm trying to build an Eclipse RCP application and build it with
Tycho. The "problem" is that I need to use a thirdparty dependency
(OSGi bundle) with two transitive dependencies (also OSGi bundles),
which I get from a Maven repository.
I can resolve these without problems for a simple Maven project with
the maven-bundle-plugin [Listing 1]. However, when I try to utilize
the Tycho demo itp02 (referenced in
https://docs.sonatype.org/display/TYCHO/Dependency+on+pom-first+artifacts) the
build fails. The first step (creating a bundle including the pom-first
dependencies) works fine, but the second step of the build (building
the Plugin that uses the pom-first bundle created in Step 1) fails
with a dependency resolution error.
I have asked over at the tycho-user list, and they have said that I
can either "tell maven-bundle-plugin to embed all required
dependencies, or 'wrap' each dependency in a bundle".
As I'm very new to Felix, I don't know how to achieve this. Perhaps
some of you have had similar issues or are using Tycho and can say
something about it?
The error message I am getting is in [Listing 3] and the <build> part
of the pom for building the dependency bundle is in [Listing 2].
Any help would be *much* appreciated!
Thanks,
Stephan
-----
[Listing 1, excerpt from Maven project pom.xml]
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.1.0</version>
<extensions>true</extensions>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
<configuration>
<manifestLocation>${basedir}/META-INF</manifestLocation>
<source>1.6</source>
<target>1.6</target>
<instructions>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Bundle-SymbolicName>${project.groupId}.${project.artifactId};singleton:=true</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-RequiredExecutionEnvironment>JavaSE-1.6</Bundle-RequiredExecutionEnvironment>
</instructions>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e
settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<versionRange>[2.1.0,)</versionRange>
<goals>
<goal>manifest</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
-----
[Listing 2]
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Embed-Dependency>
*
</Embed-Dependency>
<_exportcontents>
de.hu_berlin.german.korpling.saltnpepper.salt-saltCommon.*;version="1.1.3-SNAPSHOT",
de.hu_berlin.german.korpling.saltnpepper.salt-saltCore.*;version="1.1.3-SNAPSHOT",
de.hu_berlin.german.korpling.saltnpepper.salt-graph.*;version="1.1.3-SNAPSHOT"
</_exportcontents>
<Bundle-ClassPath>{maven-dependencies}</Bundle-ClassPath>
<Embed-Transitive>true</Embed-Transitive>
<Embed-Directory>jars</Embed-Directory>
<_failok>true</_failok>
<_nouses>true</_nouses>
</instructions>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<lifecycleMappings>
<lifecycleMapping>
<packagingType>bundle</packagingType>
<lifecycleMappingId>org.sonatype.tycho.m2e.wrapperBundle</lifecycleMappingId>
</lifecycleMapping>
</lifecycleMappings>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<versionRange>2.1.0</versionRange>
<goals>
<goal>bundle</goal>
</goals>
</pluginExecutionFilter>
<action>
<configurator>
<id>org.sonatype.tycho.m2e.wrapperBundle</id>
</configurator>
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<versionRange>2.1.0</versionRange>
<goals>
<goal>manifest</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
-----
[Listing 3]
[ERROR] Internal error: java.lang.RuntimeException: Could not resolve
project dependencies: Missing:
[ERROR] ----------
[ERROR] 1)
de.hu_berlin.german.korpling.saltnpepper:salt-graph:bundle:1.1.3-SNAPSHOT
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file
-DgroupId=de.hu_berlin.german.korpling.saltnpepper
-DartifactId=salt-graph -Dversion=1.1.3-SNAPSHOT -Dpackaging=bundle
-Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy
the file there:
[ERROR] mvn deploy:deploy-file
-DgroupId=de.hu_berlin.german.korpling.saltnpepper
-DartifactId=salt-graph -Dversion=1.1.3-SNAPSHOT -Dpackaging=bundle
-Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR] Path to dependency:
[ERROR] 1) tycho.demo.itp02:tycho.demo.itp02.bundle:pom:1.0.0-SNAPSHOT
[ERROR] 2) tycho.demo.itp02:pomfirst-bundle:jar:1.0.0-SNAPSHOT
[ERROR] 3)
de.hu_berlin.german.korpling.saltnpepper:salt-saltCommon:jar:1.1.3-SNAPSHOT
[ERROR] 4)
de.hu_berlin.german.korpling.saltnpepper:salt-graph:bundle:1.1.3-SNAPSHOT
...
The same for
de.hu_berlin.german.korpling.saltnpepper:salt-saltCore:bundle:1.1.3-SNAPSHOT
----------------------------------------------------------------
This message was sent through https://webmail.uni-jena.de
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]