Monolith-Generator Maven Plugin

Maven plugin to generate self-contained versions of declared plugins and other artifacts.

Лицензия

Лицензия

APLv2.0
Категории

Категории

Maven Компиляция и сборка
Группа

Группа

org.commonjava.maven.plugins
Идентификатор

Идентификатор

monolith-maven-plugin
Последняя версия

Последняя версия

0.2
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

Monolith-Generator Maven Plugin
Maven plugin to generate self-contained versions of declared plugins and other artifacts.
Ссылка на сайт

Ссылка на сайт

http://github.com/jdcasey/monolith-maven-plugin
Система контроля версий

Система контроля версий

http://github.com/jdcasey/monolith-maven-plugin

Скачать monolith-maven-plugin

Как подключить последнюю версию

<plugin>
    <groupId>org.commonjava.maven.plugins</groupId>
    <artifactId>monolith-maven-plugin</artifactId>
    <version>0.2</version>
</plugin>

Зависимости

compile (5)

Идентификатор библиотеки Тип Версия
org.apache.maven.plugins : maven-assembly-plugin jar 2.4
org.commonjava.maven.atlas : atlas-identities jar 0.7.0
commons-lang : commons-lang jar 2.4
commons-io : commons-io jar 2.4
org.sonatype.aether : aether-util jar 1.13.1

provided (3)

Идентификатор библиотеки Тип Версия
org.apache.maven : maven-plugin-api jar 3.0.3
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.2
org.apache.maven : maven-core jar 3.0.3

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.10

Модули Проекта

Данный проект не имеет модулей.

Monolith Plugin for Apache Maven

This plugin reads the entries in your POM's dependencyManagement and pluginManagement sections, and generates monolithic, self-contained assemblies for each. That is, self-contained EXCEPT when they reference other monoliths declared in the current project. In the case of plugins, these assemblies are usable as drop-in replacements for the original plugin...just adjust the version to the new, qualified version, and away you go.

Why??

In cleanroom environments, it's often desirable to avoid mixing built-time / toolchain libraries with the libraries you're building. When you're doing Maven builds, it's not enough to simply keep track of the plugins you're using. Each plugin has its own dependency graph, and if that graph overlaps with something you're trying to build and ship, it can cause a chicken-and-egg scenario that makes it hard to guarantee that what you're shipping is actually the code that you built, and not something you imported for the sake of supporting a plugin.

This is where monoliths come in handy. By creating self-contained plugins (and other libraries used during a Maven build), you avoid questions of dependency-graph overlap.

How To Use

Imagine you want to create a self-contained version of the Maven Archetype Plugin. However, since you want to manage the archetypes you're planning on shipping, you actually need a self-contained version of the archetype-packaging artifact. It's possible this artifact is already self-contained...for the purposes of this example, assume it's not.

Simply create a new Maven project, and in the pom.xml add this:

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.apache.maven.archetype</groupId>
      <artifactId>archetype-packaging</artifactId>
      <version>2.2</version>
    </dependency>
  </dependencies>
</dependencyManagement>

<build>
  <pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-archetype-plugin</artifactId>
        <version>2.2</version>
      </plugin>
    </plugins>
  </pluginManagement>
</build>

Then, issue the following:

mvn org.commonjava.maven.plugins:monolith-maven-plugin:create

When Maven finishes, the basic output (i.e. monolithic artifacts + poms) will be in the target/monoliths directory. Additionally, the plugin generates a partial local repository (by installing these artifacts and POMs) in target/installed. It also generates a partial remote repository (by deploy'ing these artifacts and POMs) in target/deployed.

Making That Last Call Simpler

If you want to simplify the Maven command line you must run, try adding the following to your settings.xml:

<pluginGroups>
  <pluginGroup>org.commonjava.maven.plugins</pluginGroup>
</pluginGroups>

Then, the command you must issue becomes:

mvn monolith:create

Версии библиотеки

Версия
0.2
0.1