神器网站列出了 6 种类型的 repo,并声称此命名模式是最佳实践:
我有两个问题,
- 应该在 plugins-* 存储库中存储什么。请举一个具体的例子。我不明白为什么插件应该有一个单独的仓库。
- 此最佳做法记录在何处?
https://www.jfrog.com/confluence/display/RTF/Local+Repositories
libs-release-local = Your code releases
libs-snapshot-local= Your code snapshots
ext-release-local = Manually deployed 3rd party libs (releases)
ext-snapshot-local = Manually deployed 3rd party libs (shapshots)
plugins-release-local = Your and 3rd party plugins (releases)
plugins-snapshot-local = Your and 3rd party plugins (snapshots)
最佳答案
Artifactory 做出这种区分只是因为 Maven 做出了区分。这是为了与 Maven 保持一致。
在 Maven 中,依赖项的存储库和插件的存储库在 2 个不同的标记中声明:即 <repositories>
对于依赖项和 <pluginRepositories>
对于插件。
插件存储库用于声明对插件的依赖性。例如, maven-compiler-plugin
由 Maven 正确解析,因为 <pluginRepository>
在 Super POM 中定义(实际上指向 Maven Central)。如果您要开发公司内部的 Maven 插件,最好将其存储在 plugins-*
中。 repo 。
关于这个“最佳实践”没有任何官方页面(至少我能找到),但请注意 quoting the Maven docs (强调我的):
Repositories are home to two major types of artifacts. The first are artifacts that are used as dependencies of other artifacts. These are the majority of plugins that reside within central. The other type of artifact is plugins. Maven plugins are themselves a special type of artifact. Because of this, plugin repositories may be separated from other repositories (although, I have yet to hear a convincing argument for doing so). In any case, the structure of the
pluginRepositories
element block is similar to the repositories element. ThepluginRepository
elements each specify a remote location of where Maven can find new plugins.
关于maven - 什么应该存储在 "plugins-release-local"和 "plugins-snapshot-local"存储库中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34845201/