Search code examples
mavenartifactoryrelease-management

What should be stored in "plugins-release-local" and "plugins-snapshot-local" repository


The artifactory website lists 6 types of repo and claims this naming schema is best practice:

I have 2 questions,

  1. What should be stored in plugins-* repos. Please give a concrete example. I don't understand why plugins should have a separate repo.
  2. Where is this best practice documented?

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)

Solution

  • Artifactory makes this distinction only because Maven makes it. This is to be consistent with Maven.

    In Maven, repositories for dependencies and repositories for plugins are declared in 2 differents tags: namely <repositories> for dependencies and <pluginRepositories> for plugins.

    Plugin repositories are used to declare dependencies toward plugins. For example, the maven-compiler-plugin is correctly resolved by Maven because a <pluginRepository> is defined in the Super POM (that actually points to Maven Central). If you were to develop a Maven plugin, internal to your company, it would be best to store it inside the plugins-* repo.

    There isn't any official page (that I could find at least) regarding this "best practice", but do note that quoting the Maven docs (emphasis mine):

    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. The pluginRepository elements each specify a remote location of where Maven can find new plugins.