gpt4 book ai didi

dependencies - 是否可以从 p2 repo 解决 maven 插件中的依赖项

转载 作者:行者123 更新时间:2023-12-04 01:15:01 25 4
gpt4 key购买 nike

我正在开发一个 maven 插件,它将用于覆盖默认的 maven 生命周期,并将使用我的代码。我有多个相同的 jar 依赖项(eclipse 和我的另一个应用程序插件)。我有那些 jar 的 p2 repo 。如何集成这两者来解决所有依赖关系?
Tycho 不能使用,因为它只能用于 RCP 应用程序(我的理解/误解)。

与此类似 - question

还有其他解决方法吗?

最佳答案

你看过这个 git 吗?
https://github.com/reficio/p2-maven-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

关于dependencies - 是否可以从 p2 repo 解决 maven 插件中的依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38099426/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com