Apache

Docs Plugins

AntRun Plugin 3.2.0 · Other versions

Runs Ant scripts embedded in the POM

Source
Edit this page
Wrong?
Report a problem

VersionMapper

This is an Ant mapper class which can be used to remove the versions from the dependency artifact filenames..

Example

This example shows how to use the version mapper.

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>3.2.0</version>
        <executions>
          <execution>
            <id>copy-dependencies</id>
            <phase>package</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <mapper id="remove-versions"
                        classname="org.apache.maven.ant.tasks.support.VersionMapper"
                        from="${maven.project.dependencies.versions}"
                        to="flatten" />
                <copy todir="lib" flatten="true">
                  <path>
                    <pathelement path="${maven.dependency.classpath}"/>
                  </path>
                  <mapper refid="remove-versions" />
                </copy>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>