There seems to be many ways to achieve this. One way is with the maven-resources-plugin and a profile. The release-plugin sets during release:perform
the profile release-plugin
. You simply have add the maven-resources-plugin into that profile (or a custom profile which is activated by <releaseProfiles>
).
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/test-classes</outputDirectory>
<resources>
<resource>
<directory>${basedir}/../../src/test/resources/</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
With org.sonatype.oss:oss-parent it's a bit different, as that parent disables <useReleaseProfile>
but uses sonatype-oss-release
.