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

AttributeDescriptionRequired
fileThe file to attach to the projectYes
classifierA classifier assigned to the artifactNo, defaults to no classifier
typeThe type of the artifact, zip, war, etcNo, 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>1.7</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>