Copy Resources

You can use the mojo copy-resources to copy resources which are not in the default maven layout or not declared in the build/resources element and attach it to a phase

  1. <project>
  2. ...
  3. <build>
  4. <plugins>
  5. <plugin>
  6. <artifactId>maven-resources-plugin</artifactId>
  7. <version>3.3.1</version>
  8. <executions>
  9. <execution>
  10. <id>copy-resources</id>
  11. <!-- here the phase you need -->
  12. <phase>validate</phase>
  13. <goals>
  14. <goal>copy-resources</goal>
  15. </goals>
  16. <configuration>
  17. <outputDirectory>${basedir}/target/extra-resources</outputDirectory>
  18. <resources>
  19. <resource>
  20. <directory>src/non-packaged-resources</directory>
  21. <filtering>true</filtering>
  22. </resource>
  23. </resources>
  24. </configuration>
  25. </execution>
  26. </executions>
  27. </plugin>
  28. </plugins>
  29. ...
  30. </build>
  31. ...
  32. </project>