Fork me on GitHub

Copies file to output directory with a new name

This example shows how use the copyFile goal to copy pom.xml file to target directory with a new name equal to artifact-1.0.pom.

<project>
   ...
   <groupId>org.example</groupId>
   <artifactId>artifact</artifactId>
   <version>1.0</version>
   ...
   <build>
      <plugins>
         ...
         <plugin>
            <groupId>biz.gabrys.maven.plugins</groupId>
            <artifactId>directory-content-maven-plugin</artifactId>
            <version>1.2.1</version>
            <executions>
               <execution>
                  <goals>
                     <goal>copyFile</goal>
                  </goals>
                  <configuration>
                     <sourceFilePath>pom.xml</sourceFilePath>
                     <outputFilePath>${project.artifactId}-${project.version}.pom</outputFilePath>
                  </configuration>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>
<project>