Question

I want to generate a P2 repository from OSGI bundles that reside on maven central. I have

  1. defined a POM-first feature project using dependencies=consider
  2. defined Maven dependencies with scope compile and type jar
  3. defined a feature.xml with exact references to the bundle symbolic names and versions as declared in their manifest.mf

When I attempt to build the feature, I receive

No solution found because the problem is unsatisfiable.": ["Unable to satisfy dependency from org.codehaus.jackson.feature.group 1.9.1.qualifier to jackson-mapper-lgpl [1.9.12,1.9.13).", "Unable to satisfy dependency from org.codehaus.jackson.feature.group 1.9.1.qualifier to jackson-core-lgpl [1.9.12,1.9.13).", "No solution found because the problem is unsatisfiable."] 

Where org.codehaus.jackson.feature is the feature I am building and jackson-mapper-lgpl [1.9.12,1.9.13) and jackson-core-lgpl [1.9.12,1.9.13) are the specifications of the OSGI bundles I am trying to include.

When I switch on debug mode, I see that the components are being found, which makes the behavior more odd:

[DEBUG] P2Resolver: artifact org.codehaus.jackson:jackson-core-lgpl:1.9.12 at location /home/jsuess/.m2/repository/org/codehaus/jackson/jackson-core-lgpl/1.9.12/jackson-core-lgpl-1.9.12.jar resolves installable unit jackson-core-lgpl/1.9.12
[DEBUG] P2resolver.addMavenArtifact org.codehaus.jackson:jackson-mapper-lgpl:jar:1.9.12:compile
[DEBUG] P2Resolver: artifact org.codehaus.jackson:jackson-mapper-lgpl:1.9.12 at location /home/jsuess/.m2/repository/org/codehaus/jackson/jackson-mapper-lgpl/1.9.12/jackson-mapper-lgpl-1.9.12.jar resolves installable unit jackson-mapper-lgpl/1.9.12
[DEBUG] Registered artifact repository org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey(uri=file:/resolution-context-artifacts@/home/jsuess/workspace/org.codehaus.jackson/features/org.codehaus.jackson)

I believe taking bundles from maven and creating P2 must be a common use case, so I wonder if someone can point me to a working sample POM that I can use as a template.

Was it helpful?

Solution

Note that every module in a Tycho build has a separate target platform.

So if you are using pomDependencies=consider, but you only configure this switch and/or the dependencies on an eclipse-feature module, the POM dependencies will only be in the target platform of the module. If you then try to package the feature into an eclipse-repository, the dependency resolution of that module will fail because of missing (transitive) dependencies of the feature.

In most cases, you don't need different target platforms per module, so in general you should put all target platform configuration and POM dependencies into the parent POM.


If you have done this, but one of your modules still seems to have a different target platform, make sure that the parent POM reference of that module is correct - and that you don't reference an older version of your parent POM.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top