Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 349347

Summary: POM Dependencies and Feature can't handle x.x.x.x-SNAPSHOT
Product: z_Archived Reporter: David Carver <d_a_carver>
Component: TychoAssignee: Project Inbox <tycho-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: igor, mistria
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description David Carver CLA 2011-06-14 13:01:42 EDT
I'm creating some maven artifacts that have had the manifest updated with OSGI information using the maven-bundle-plugin.   I want to use Tycho to create a P2 update site for these bundles.   So I created a feature XML file that pulls in these bundles, using the POM Dependencies ability of tycho.

However, since a feature.xml only specifies a 3 digit version number, I can't pull these depenencies that have a 4 digit version number.   Some sample output:


[INFO] Resolving target platform for project MavenProject: org.ebayopensource.turmeric.runtime:org.ebayopensource.turmeric.runtime.feature:1.0.1-SNAPSHOT @ /home/dcarver/Work/ebay/ebay-git/turmeric-runtime/p2/org.ebayopensource.turmeric.runtime.feature/pom.xml
[WARNING] Missing POM for org.ebayopensource.turmeric.runtime:binding-framework:jar:1.0.1-SNAPSHOT
[WARNING] Missing POM for org.ebayopensource.turmeric.runtime:soa-client:jar:1.0.1-SNAPSHOT
[WARNING] Missing POM for org.ebayopensource.turmeric.runtime:soa-server:jar:1.0.1-SNAPSHOT
[WARNING] Missing POM for org.ebayopensource.turmeric.codegen:codegen-tools:jar:1.0.1-SNAPSHOT
[WARNING] Missing POM for org.ebayopensource.turmeric.typelib:codegen-tools:jar:1.0.1-SNAPSHOT
[WARNING] Missing POM for org.ebayopensource.turmeric.errorlib:runtime-error-library:jar:1.0.1-SNAPSHOT
[ERROR] Internal error: java.lang.RuntimeException: Could not resolve project dependencies: Missing:


The versions it should be looking for, are 1.0.1.0-SNAPSHOT.   A work around would be for me to build versions of these jars with the different version number, but I'd like to avoid that if possible.
Comment 1 Igor Fedorenko CLA 2011-06-14 16:13:24 EDT
maven-bundle-plugin will translate 1.0.1.0-SNAPSHOT Maven version to four part OSGi version with major.manor.micro parts set to 1.0.1 and version qualifier to 0-SNAPSHOT. Here is relevant quote from http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html '... but is normalized to the OSGi version format of "MAJOR.MINOR.MICRO.QUALIFIER", for example "2.1-SNAPSHOT" would become "2.1.0.SNAPSHOT" '

This means that pom.xml <dependency> element should use 1.0.1.0-SNAPSHOT and feature.xml should use 1.0.0.qualifier to refer the same dependency.

If still does not work, please feel free to reopen, but make sure to provide complete standalone example project and steps to reproduce the problem.
Comment 2 David Carver CLA 2011-06-14 16:37:16 EDT
(In reply to comment #1)
> maven-bundle-plugin will translate 1.0.1.0-SNAPSHOT Maven version to four part
> OSGi version with major.manor.micro parts set to 1.0.1 and version qualifier to
> 0-SNAPSHOT. Here is relevant quote from
> http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html '... but
> is normalized to the OSGi version format of "MAJOR.MINOR.MICRO.QUALIFIER", for
> example "2.1-SNAPSHOT" would become "2.1.0.SNAPSHOT" '
> 
> This means that pom.xml <dependency> element should use 1.0.1.0-SNAPSHOT and
> feature.xml should use 1.0.0.qualifier to refer the same dependency.
> 
> If still does not work, please feel free to reopen, but make sure to provide
> complete standalone example project and steps to reproduce the problem.

I'll do some more checking, but I have the feature.xml set to use version "0.0.0" which should pull in any version.  What it is trying to pull in is 1.0.1-SNAPSHOT.  The dependency is setup with 1.0.1.0-SNAPSHOT (actually, ${project.version}).

I have an example that is publicly available at:

https://github.com/kingargyle/turmeric-runtime/tree/turmeric-1261

I'll do some more experiments today, if I still get the issue, I'll re-open.
Comment 3 David Carver CLA 2011-06-20 16:59:45 EDT
I need to re-open this, as I'm still running into some issues.

I'm still having problems with getting things to work as expected.  I'm getting the following stacktrace and log output:

INFO] Resolving target platform for project MavenProject: org.ebayopensource.turmeric.runtime:org.ebayopensource.turmeric.runtime.feature:1.0.1-SNAPSHOT @ /home/dcarver/.jenkins/jobs/runtime/workspace/p2/org.ebayopensource.turmeric.runtime.feature/pom.xml
[DEBUG] P2resolver.addMavenProject org.ebayopensource.turmeric.runtime:org.ebayopensource.turmeric.runtime.feature:eclipse-feature:1.0.1-SNAPSHOT
[DEBUG] P2resolver.addMavenProject org.ebayopensource.turmeric.tools.eclipse:org.ebayopensource.tumeric.eclipse.repository:eclipse-update-site:1.0.0-SNAPSHOT
[DEBUG] P2resolver.addMavenProject org.ebayopensource.turmeric.runtime:turmeric-runtime-p2:pom:1.0.1.0-SNAPSHOT
[DEBUG] P2resolver.addMavenProject org.ebayopensource.turmeric.runtime:turmeric-runtime-p2-parent:pom:1.0.1.0-SNAPSHOT
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for /home/dcarver/.m2/repository
[DEBUG] Ignoring Maven repository ebayopensource-releases (http://www.ebayopensource.org/nexus/content/repositories/releases)
[DEBUG] Ignoring Maven repository ebayopensource-snapshots (http://www.ebayopensource.org/nexus/content/repositories/snapshots)
[DEBUG] Ignoring Maven repository codehaus (http://snapshots.repository.codehaus.org/)
[INFO] Adding repository http://download.eclipse.org/releases/helios/
[INFO] Adding repository http://download.eclipse.org/releases/helios/
[DEBUG] Added p2 repository helios (http://download.eclipse.org/releases/helios/)
[INFO] Adding repository http://download.eclipse.org/tools/orbit/downloads/drops/R20100519200754/repository
[INFO] Adding repository http://download.eclipse.org/tools/orbit/downloads/drops/R20100519200754/repository
[DEBUG] Added p2 repository orbit (http://download.eclipse.org/tools/orbit/downloads/drops/R20100519200754/repository)
[INFO] Adding repository http://m2eclipse.sonatype.org/sites/m2e
[INFO] Adding repository http://m2eclipse.sonatype.org/sites/m2e
[DEBUG] Added p2 repository m2eclipse (http://m2eclipse.sonatype.org/sites/m2e)
[DEBUG] Ignoring Maven repository ebayopensource (http://www.ebayopensource.org/nexus/content/groups/public)
[INFO] Cannot complete the request.  Generating details.
[INFO] {org.osgi.framework.executionenvironment=OSGi/Minimum-1.0,OSGi/Minimum-1.1, osgi.ws=gtk, osgi.arch=x86, osgi.os=linux, org.eclipse.update.install.features=true, org.osgi.framework.system.packages=}
[INFO] [Software being installed: org.ebayopensource.turmeric.runtime.feature.feature.group 1.0.1.qualifier, Missing requirement: org.ebayopensource.turmeric.runtime.feature.feature.group 1.0.1.qualifier requires 'binding-framework [1.0.1,1.0.2)' but it could not be found]
[ERROR] Internal error: java.lang.RuntimeException: org.eclipse.equinox.p2.core.ProvisionException: No solution found because the problem is unsatisfiable. -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: org.eclipse.equinox.p2.core.ProvisionException: No solution found because the problem is unsatisfiable.
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:168)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
	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:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.RuntimeException: org.eclipse.equinox.p2.core.ProvisionException: No solution found because the problem is unsatisfiable.
	at org.eclipse.tycho.p2.impl.resolver.ProjectorResolutionStrategy.resolve(ProjectorResolutionStrategy.java:102)
	at org.eclipse.tycho.p2.impl.resolver.P2ResolverImpl.resolveProject(P2ResolverImpl.java:324)
	at org.eclipse.tycho.p2.impl.resolver.P2ResolverImpl.resolveProject(P2ResolverImpl.java:293)
	at org.eclipse.tycho.p2.facade.P2TargetPlatformResolver.doResolvePlatform(P2TargetPlatformResolver.java:389)
	at org.eclipse.tycho.p2.facade.P2TargetPlatformResolver.resolvePlatform(P2TargetPlatformResolver.java:150)
	at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.resolveProject(DefaultTychoDependencyResolver.java:90)
	at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:91)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:273)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
	... 11 more
Caused by: org.eclipse.equinox.p2.core.ProvisionException: No solution found because the problem is unsatisfiable.
	... 20 more


I've checked that the binding-framework-1.0.1.0-SNAPSHOT jar, has the correct Symbolic Name and Version (binding-framework, and 1.0.1.0-SNAPSHOT) specified. The feature xml is specified to pickup 1.0.1 as the version.  My prefered method would be to specify 0.0.0 as the version and let it pick up anything but that doesn't seem to be working either.

I project that can be run and tested to show this can be found at:

https://github.com/kingargyle/turmeric-runtime/tree/turmeric-1261

There is a settings.xml file that should be used during the build to make sure all necessary dependencies are picked up for the two phase build.

Steps to reproduce:
1. Clone the git repostiory
2. Check out the turmeric-1261 branch.
3. Run the pom frist build, mvn clean install -s settings.xml -DskipTests=true
4. Run the tycho build mvn install -f p2pom.xml -s settings.xml

When it tries to build the feature project, it will fail, as it says it can't find the dependencies.  I do have items setup so that pomDependencies = consider on the p2pom.xml file.

I'm sure it is something stupid on my part I'm doing wrong but just can't see what that is.
Comment 4 Mickael Istria CLA 2020-06-29 08:42:03 EDT
This issue doesn't seem relevant anymore.