Tuesday, December 24, 2019

How to copy file(s) with Maven

Example shows how to copy file(s) with Maven


<!-- copy files --><plugin>
    <artifactId>maven-resources-plugin</artifactId>
    <version>3.1.0</version>
    <executions>
        <execution>
            <id>copy-config</id>
            <!-- here the phase you need -->            <phase>install</phase>
            <goals>
                <goal>copy-resources</goal>
            </goals>
            <configuration>
                <outputDirectory>${basedir}/target/directory</outputDirectory>
                <resources>
                    <resource>
                        <filtering>true</filtering>
                        <directory>src/source/directory</directory>
                        <includes>
                            <include>file_to_copy</include>
                        </includes>
                    </resource>
                </resources>
            </configuration>
        </execution>
    </executions>
</plugin>


Build!!

No comments:

Post a Comment

LinkWithin

Related Posts Plugin for WordPress, Blogger...