AttachArtifact Task
This task will attatch an artifact to the current Maven project. This is can be used to install and deploy an artifact generated by the Ant tasks.
Task Parameters
Attribute | Description | Required |
---|---|---|
file | The file to attach to the project | Yes |
classifier | A classifier assigned to the artifact | No, defaults to no classifier |
type | The type of the artifact, zip, war, etc | No, defaults to jar |
Example
This example shows how to use the attachartifact
task.
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>3.1.0</version> <executions> <execution> <id>attach-artifact</id> <phase>package</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <zip destfile="my-project-src.zip" basedir="." includes="*.*" /> <attachartifact file="my-project-src.zip" classifier="src" type="zip"/> </target> </configuration> </execution> </executions> </plugin>