Usage Example

Distribution from a library and some third-party dependencies

In this example a plugin distribution is created for the artifact company.jameica.plugin:library and the third party artifact other.dependency:some-name.

A distribution consists of the given dependencies including all transitive runtime dependencies. By this all test, provided and system scoped dependencies are excluded.

<?xml version="1.0" encoding="UTF-8"?>
<project>
  <modelVersion>4.0.0</modelVersion>
  
  <groupId>company.jameica.plugin</groupId>
  <artifactId>distribution</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jameica-plugin</packaging>

  <dependencies>
    <dependency>
      <groupId>company.jameica.plugin</groupId>
      <artifactId>library</artifactId>
      <version>1.0-SNAPSHOT</version>
    </dependency>
    <dependency>
      <groupId>other.dependency</groupId>
      <artifactId>some-name</artifactId>
      <version>2.3</version>
    </dependency>
  </dependencies>

  <build>
    <finalName>plugin-final-name</finalName>
    <plugins>
      <plugin>
        <groupId>de.esw.maven.plugin</groupId>
        <artifactId>maven-jameica-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <dependenciesDirectory>
            libs
          </dependenciesDirectory>
          <pluginArtifact>
            company.jameica.plugin:library:1.0-SNAPSHOT
          </pluginArtifact>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <pluginRepositories>
    <pluginRepository>
      <id>repository.maven.emedia-solutions-wolf.de</id>
      <url>http://maven.emedia-solutions-wolf.de/artifactory/repo/</url>
    </pluginRepository>
  </pluginRepositories>
</project>

The configuration specifies that the result plugin will be named plugin-final-name.zip and all dependencies should be copied to a subfolder named libs .

The jameica plugin.xml file is copied from /META-INF/jameica/plugin.xml in the specified artifact (company.jameica.plugin:library:1.0-SNAPSHOT).

The resulting file structure will be like this:

plugin-final-name
|-- plugin.xml
`-- libs
    |-- library-1.0-SNAPSHOT.jar
    |-- some-name-2.3.jar
    |-- some-dep.jar
    `-- some-other.jar