1

Note: before someone mark this issue as duplicate please note I have already read and tried solutions suggested in following similar threads which did not work for me:

Maven:Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.7:resources

and

https://issues.apache.org/jira/browse/MSHARED-223

I see following on my CLI after I execute 'mvn -X clean compile|package':

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:copy-resources (copy-resources) on project empl-monthly-payslip: Execution copy-resources of goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:copy-resources failed. NullPointerException -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:copy-resources (copy-resources) on project empl-monthly-payslip: Execution copy-resources of goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:copy-resources failed. at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.PluginExecutionException: Execution copy-resources of goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:copy-resources failed. at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) ... 20 more

Here is the relevant part of my POM file:

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <jdk.version>1.8</jdk.version>
    <maven.compiler.version>3.6.1</maven.compiler.version>
    <maven.assembly.version>3.0.0</maven.assembly.version>
    <maven.resources.version>3.0.2</maven.resources.version>
  </properties>

      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${maven.resources.version}</version>
        <executions>
          <execution>
            <id>copy-resources</id>
            <phase>validate</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${basedir}/target</outputDirectory>
              <includeEmptyDirs>true</includeEmptyDirs>
              <resources>
                <resource>
                  <targetPath>${basedir}/src/main/resources</targetPath>
                  <filtering>false</filtering>
                  <includes>
                    <include>*</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>     
    </plugins>
  </build>
</project>

I want to copy all resources (recursively) that are at ${basedir}/src/main/resources folder. Any help/advise greatly appreciated.

Note: I'm using Apache Maven 3.3.9. And have also tried cleaning everything under my ~/.m2/repository and compiling again.

Jamey
  • 813
  • 1
  • 12
  • 27
Rav
  • 11
  • 3
  • sorry...two threads in the description above got duplicated. I meant this one as well that I've read and tried already: https://stackoverflow.com/questions/6816407/strange-nullpointerexception-in-maven-resources-plugin – Rav Jun 26 '17 at 10:08

0 Answers0