[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] pom-first dependencies and target platform

I think I understand the problem you are seeing, but your reasoning is not quite right.

The POM dependencies that are being considered are the effective dependencies (as in the effective POM) of the current module. This is done at a point in the build where Tycho has not yet injected the OSGi dependencies into the Maven model. So if you have an eclipse-plugin module with a POM dependencies on some GAV bundle, and an eclipse-feature module that includes your bundle, there is no POM/Maven model dependency from the eclipse-feature module to the GAV bundle. Therefore the GAV bundle would not be considered for the eclipse-feature module and hence the (transitive) dependency resolution for that module would fail.

To work around this problem, one puts the POM dependencies into the parent POM (together with the pomDependencies=consider configuration), so that the POM dependencies become part of the target platform of *all* modules and hence transitive dependencies can be resolved. This is really a known limitation [1], but AFAIK there is no bug report for this yet...

I've also added a note about this pitfall in the target platform documentation [2]. 

Regards
Tobias

[1] http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts#Pom-first_dependencies_of_manifest-first_projects_are_not_fully_transitive
[2] http://wiki.eclipse.org/Tycho/Target_Platform#.22POM_dependencies_consider.22

> -----Original Message-----
> From: tycho-user-bounces@xxxxxxxxxxx [mailto:tycho-user-
> bounces@xxxxxxxxxxx] On Behalf Of Barrie Treloar
> Sent: Dienstag, 10. Juli 2012 07:16
> To: Tycho user list
> Subject: [tycho-user] pom-first dependencies and target platform
> 
> This should be blindingly obvious but I guess I still have my Maven
> dependency hat on and therefore getting confused.
> I previously had the dependency in my bundle's pom.xml and then wasted
> a day or so trying to work out why this isn't working.
> 
> I've updated http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-
> first_artifacts#What_happens_under_the_hood
> to include a note about the dependency inclusion on a pom-first
> bundle.
> 
> Note: The dependencies that that the target platform will consider are
> the ones defined in the pom that specifies the
> target-platform-configuration.
> Your bundles should not have any Maven dependencies since OSGi
> dependencies are specified Manifest-First in MANIFEST.MF as
> Import-Package (or Require-Bundle).
> _______________________________________________
> tycho-user mailing list
> tycho-user@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/tycho-user