How to call maven-resources-plugin programmatically
I am writing a custom Maven plugin and part of the plugin's job is to filter-copy some resources. The code I've written looks like this: CopyResourcesMojo rm = new CopyResourcesMojo(); rm.setOutputDirectory(outputDir); //determined dynamically in a loop rm.setOverwrite(true); rm.setFilters(filters); //determined dynamically in a loop rm.setResources(this.resources); //Actually is of type List<Resource> rm.execute(); //NulPointerException because rm's project member is null. This throws a NullPointerException because the CopyResourceMojo doesn't have access to my mojo's project , and the