Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Resolve Maven plugin dependencies from target platform?

Hi Igor,

thank you for your insights.

> This is theoretically possible, but Tycho does not do this right now and
> I am not aware of any attempts to implement this either.
> 
> I am not even sure you need/want to make this part of Tycho. What you
> are looking for, basically, is Maven repository layout implementation
> that is able to perform jar and pom (!) artifact lookup based on maven
> artifactcoordinates. This is quite different from what Tycho does not
> project dependencies.
> 
> The difficult part is, of course, figuring out how to represent OSGi
> dependencies in Maven, but maybe you can get away by simply ignoring the
> problem.
> 
> If you really need just couple of dependencies, however, it is probably
> easier to manually publish the required artifacts to a Maven repository.
> This is how we make equinox and jdt compiler available for Tycho [2].

I think the situation is different in case of the xtext-maven-plugin
(which may be a weird outlier, admittedly).

In the case of the JDT compiler you have an OSGi bundle that you want to
make available to your Maven build. A "mvn deploy:deploy-file" does just
that (of course, where the POM comes from is interesting). The JDT
compiler bundle is needed only as a dependency of the plugin, though.

In the case of the xtext-maven-plugin, however, some bundles like
org.eclipse.emf.ecore.xcore.lib are needed both by the plugin [1] (a
code generator) and by the project that the code is generated for [2].
Ideally, the project's and the plugin's org.eclipse.emf.ecore.xcore.lib
dependency would be identical. At the very least, their versions should
not diverge too much, as then the generated code would no longer work
with the org.eclipse.emf.ecore.xcore.lib used to compile/run it.

However, keeping the versions in sync is cumbersome, as the project
dependencies' versions are governed by the target platform and the
plugin dependencies' versions are governed by the pom.xml. Hope that
this explains a bit better what my perceived problem is (Disclaimer: I
am no Xtext/Xcore expert).

Best wishes,

Andreas

[1]
<https://git.eclipse.org/c/recommenders/org.eclipse.recommenders.git/tree/plugins/org.eclipse.recommenders.stacktraces.model/pom.xml?id=v2.1.10#n44>
[2]
<https://git.eclipse.org/c/recommenders/org.eclipse.recommenders.git/tree/plugins/org.eclipse.recommenders.stacktraces.model/META-INF/MANIFEST.MF?id=v2.1.10#n9>

-- 
Codetrails GmbH
The knowledge transfer company

Robert-Bosch-Str. 7, 64293 Darmstadt
Phone: +49-6151-276-7092
Mobile: +49-170-811-3791
http://www.codetrails.com/

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940


Back to the top