I have project which requires one library. This lib is already in the local repro. I told the project through its pom.xml
that it depends on this lib like this:
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.mygui</groupId>
<artifactId>de.mygui.app.releng</artifactId>
<relativePath>../de.mygui.app.releng/pom.xml</relativePath>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>de.mygui</groupId>
<artifactId>de.mygui.map</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<dependencies>
<dependency>
<groupId>common</groupId>
<artifactId>my.util.geo</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</project>
and the projects manifest looks like this:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: gui map
Bundle-SymbolicName: de.mygui.map;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: my.util.geo;version="2.0.0"
The my.util.geo
manifest:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Geo
Bundle-SymbolicName: my.util.geo
Bundle-Version: 1.0.0
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: my.util.geo
Require-Bundle: org.proj4j;bundle-version="0.1.0"
When running the parent POM to compile everything (also other required projects) I get the following error:
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: de.mygui.app.feature.feature.group 1.0.0.qualifier
[ERROR] Missing requirement: de.mygui.map 1.0.0.qualifier requires 'package my.util.geo 2.0.0' but it could not be found
[ERROR] Cannot satisfy dependency: de.mygui.app.feature.feature.group 1.0.0.qualifier depends on: de.mygui.map 0.0.0
[ERROR]
[ERROR] See http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[ERROR] Cannot resolve dependencies of MavenProject: de.mygui:de.mygui.app.feature:1.0.0-SNAPSHOT @ /home/myuser/dev/gui/de.mygui.app.feature/pom.xml: See log for details -> [Help 1]
org.apache.maven.MavenExecutionException: Cannot resolve dependencies of MavenProject: de.mygui:de.mygui.app.feature:1.0.0-SNAPSHOT @ /home/myuser/dev/gui/de.mygui.app.feature/pom.xml
at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:100)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:274)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.eclipse.tycho.artifacts.DependencyResolutionException: Cannot resolve dependencies of MavenProject: de.mygui:de.mygui.app.feature:1.0.0-SNAPSHOT @ /home/myuser/dev/gui/de.mygui.app.feature/pom.xml
at org.eclipse.tycho.p2.resolver.P2ResolverImpl.resolveDependencies(P2ResolverImpl.java:202)
at org.eclipse.tycho.p2.resolver.P2ResolverImpl.resolveDependencies(P2ResolverImpl.java:116)
at org.eclipse.tycho.p2.resolver.P2DependencyResolver.doResolveDependencies(P2DependencyResolver.java:367)
at org.eclipse.tycho.p2.resolver.P2DependencyResolver.resolveDependencies(P2DependencyResolver.java:335)
at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject(DefaultTychoResolver.java:117)
at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:95)
... 13 more
Caused by: org.eclipse.tycho.p2.util.resolution.ResolverException: See log for details
at org.eclipse.tycho.p2.util.resolution.ProjectorResolutionStrategy.resolve(ProjectorResolutionStrategy.java:88)
at org.eclipse.tycho.p2.util.resolution.AbstractResolutionStrategy.resolve(AbstractResolutionStrategy.java:42)
at org.eclipse.tycho.p2.resolver.P2ResolverImpl.resolveDependencies(P2ResolverImpl.java:195)
... 18 more
To me it looks like Maven looks first into the manifest and afterwards in the POM for its dependencies. As you can see I changed the version numbers of my.util.geo
to verify that the manifest is used before the POM. Never the less even if I have the same versions in both the manifest and the POM, Maven is still not able to resolve the dependency.
What can I do to fix this problem ?