Replies: 6 comments 7 replies
-
I'm not quite sure what is suggested here, you can have "pom" features (that is a pom grouping different dependencies together) and include this in your target or reference it via maven. Maybe an example project would help to understand the use-case here. |
Beta Was this translation helpful? Give feedback.
-
@laeubi I think this one is about providing Tycho build artifacts via a Maven repo using pomless builds. 1.) Tycho builds a bunch of plug-ins and features How can the published Maven artifacts (created via Tycho) describe their requirements, e.g. how can a published feature tell Maven which components it includes? |
Beta Was this translation helpful? Give feedback.
-
The problem is that a bundle does not have "dependencies" as in the maven world, it has Capabilities but these are not necessarily fulfilled by one specific item nor by an artifact at all (e.g. a bundle might require a service) and even if by multiple ones (e.g. multiple bundles can provide the same service). All of this could not reliable be mapped to maven, even if, not all OSGi bundles are maven artifacts. Tycho generates appropriate dependencies for reactor projects but this is just a snapshot of the build and does not strictly resembles what will be resolved at runtime. |
Beta Was this translation helpful? Give feedback.
-
Thank you for all the responses. I apologize for the poor explanation, so I have created a simple example to help me illustrate my use case.
This is something Tycho already supports and which works fine, if it is just a couple of plugins. But in my situation, I would have to add 400-500 plugins like this, which is just not maintainable. I also have to manually add all of their required plugins, as well. My idea is to generate a pom file together with the artifacts, like @joeshannon mentioned, so that both can be deployed to a m2 repository. For example, example.plugin2 depends on example.plugin1 and therefore its pom may look something like this:
If I now add example.plugin2 to the target platform, both this plugin as well as its dependency will be available to the application. Furthermore, the same logic could be applied for features, which could either contain other features or the plugins directly. All of which are included automatically.
Couldn't this issue be circumvented by adding those plugins as "Required Bundles"? This functionality is only relevant if a developer wants to make an OSGi plugin available to the Maven world. So I would argue that it's their responsibility to make sure that the plugin is in a format in which the required dependencies can be determined.
That is true. And I'm not exactly sure how one would go about finding a matching Maven artifact for an OSGi bundle.
At least for my use case, the compile dependencies of the individual plugins are more than sufficient. And I think the generated dependencies are a good starting point. |
Beta Was this translation helpful? Give feedback.
-
There is no strong reason against adding it to the target pom. I imagine it was not implemented so far because it was not valuable enough for active contirbutors.
That would be worth a separate bug/discussion. I have no idea why or why not things are implemented that way; but it's worth discussing the point and re-evaluate the pros/cons of exposing feature deps to Maven model (feature deps are computed in Tycho, so exposing them to Maven model wouldn't be too hard). |
Beta Was this translation helpful? Give feedback.
-
I like this feature request. Ultimately this feature would alllow a "pure" Maven dependency flow (and remove the need for p2 repositories) for Eclipse based development. Tycho builds plug-ins as Maven libs -> they are published to a Maven repo and used by Tycho in the next build via the Maven based Target platform. |
Beta Was this translation helpful? Give feedback.
-
Hi, I've recently started building an RCP application using Tycho. Right now, I'm still using a p2 repository for deployment but in the future, I would like to switch to a Maven repository instead.
The problem is that the application is split into multiple components, which are built independently and which depend on one another. Right now this is solved by adding the required repositories to the root pom such that the Manifest dependencies can be properly resolved.
However, this approach only works if the repository has a p2 layout.
One way to fix this is deploy the bundles to a Maven repository and then add them either to the target platform definition using the m2e integration or to the Maven dependencies in the root pom. But this requires that I add each plugin individually which, given the scope of the project, is just not feasible.
I think it would be beneficial if there is an easier way to include those artifacts and to further close the gap between Maven and Eclipse.
A solution could be to attach the dependencies to the pom.xml file and include it in the OSGi bundle during the packaging phase. This way, transitive dependencies are automatically included as well.
In this case, I could them collect the plugins in a feature, which is then added as a dependency. This would make maintaining the project a lot easier and also provides users with an easy way to add OSGi bundles to a pure Maven project.
Beta Was this translation helpful? Give feedback.
All reactions