Is it possible to resolve dependencies in maven plugin from p2 repo
Asked Answered
S

1

11

I am developing one maven plugin which will be used to override the default maven lifecycles and will use my code instead. I have multiple jar dependencies (eclipse and my another application plugins) for the same. I have p2 repo for those jars. How can I integrate this two to resolve all dependencies? Tycho can not be used as it can only be used for RCP application (my understanding / misunderstanding).

Similar to this - question

Any other workaround?

Syzran answered 29/6, 2016 at 12:22 Comment(0)
M
0

Have you had a look at this git ? https://github.com/reficio/p2-maven-plugin Looks like what you are trying to achieve.

It also states the best practices of the plugin:

  • DO NOT to use the Tycho's pomDependencies->consider option as it is simply of NO good
  • DO NOT define your external dependencies in the dependencies section of the pom.xml (mvn compilation will work in the console, but it will not work in the Eclipse IDE when you import the project, since the 'Target Configuration' knows nothing about the dependencies defined there)
  • Use the MANIFEST-FIRST approach - define all your dependencies in the MANIFEST.MF files.
  • If some of your dependencies are not OSGi bundles or are not available in P2 update sites, SIMPLY define them in the p2-maven-plugin config, generate the site and make it available using jetty (or any other mechanism). Then add the URL of the exposed site to the target platform definition. In such a way you will have a consistent, manifest-first dependency management in Eclipse RCP project!
  • Whenever you have to add another external dependency, simply re-invoke "mvn p2:site" and the site will be regenerated.
  • You can automate the generation/exposition of our site using for example Jenkins and Apache2
Magistery answered 12/7, 2016 at 6:43 Comment(1)
can you please give me example of how it can be used?Syzran

© 2022 - 2024 — McMap. All rights reserved.