Description
The goal of this Annotation is to remove all dependencies from the plugin configuration and to have custom scopes so they become part of the dependency resolution when Maven is creating a buildplan.
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.10.3</version> <configuration> <taglet>package.to.YourTagletClass</taglet> <tagletArtifact> <groupId>group-Taglet</groupId> <artifactId>artifact-Taglet</artifactId> <version>version-Taglet</version> </tagletArtifact> </configuration> </plugin>
This will become
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.10.3</version> <configuration> <taglet>package.to.YourTagletClass</taglet> </configuration> <dependencies> <dependeny> <groupId>group-Taglet</groupId> <artifactId>artifact-Taglet</artifactId> <version>version-Taglet</version> <scope>taglet</taglet> </dependency> </dependencies> </plugin>
Going further: there can be project dependencies which are not part of the classpath. One concrete example is the multirelease jar, where the newer implementation classes can be added to base jar. Current solution is to have a separate (distribution) Maven module which assembles the final jar, but with the solution above it is possible to embed them already when creating the base jar.
This project would have the following dependencies:
<dependencies> <dependency> <groupId>GROUPID</groupId> <artifactId>ARTIFACTID-7</artifactId> <scope>release:7</scope> </dependency> <dependency> <groupId>GROUPID</groupId> <artifactId>ARTIFACTID-8</artifactId> <scope>release:8</scope> </dependency> </dependencies>
In the maven-jar-plugin one would have something like:
@Dependecies( label="release" ) Map<String,Artifact> releaseArtifacts; // somewhere in the code foreach( Map.Entry releaseEntry : releaseArtifacts.entrySet() ) { // copy content of release.value() to META-INF/versions/release.key() }