NPE:目标org.apache.maven.plugins的执行副本资源:maven-resources-plugin:3.0.2:copy-resources failed

时间:2017-06-26 10:06:10

标签: maven maven-resources-plugin

注意:在有人将此问题标记为重复之前,请注意我已阅读并尝试过以下类似线程中建议的解决方案,这些线程对我不起作用:

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

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

执行&m; mvn -X clean compile | package'后,我在CLI上看到了以下内容:

[错误]无法执行目标org.apache.maven.plugins:maven-resources-plugin:3.0.2:项目empl-monthly-payslip上的copy-resources(copy-resources):执行副本 - 目标资源org.apache.maven.plugins:maven-resources-plugin:3.0.2:copy-resources失败。 NullPointerException - > [帮助1] org.apache.maven.lifecycle.LifecycleExecutionException:无法执行目标org.apache.maven.plugins:maven-resources-plugin:3.0.2:项目empl-monthly-payslip上的copy-resources(copy-resources):执行副本目标资源org.apache.maven.plugins:maven-resources-plugin:3.0.2:copy-resources失败。     在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)     在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)     在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)     在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)     在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)     在org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)     在org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)     在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)     在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)     在org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)     在org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)     在org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)     在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)     在org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)     在org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)     在org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)     在org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) 引起:org.apache.maven.plugin.PluginExecutionException:目标org.apache.maven.plugins的执行副本资源:maven-resources-plugin:3.0.2:copy-resources failed。     在org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)     在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)     ......还有20个

以下是我的POM文件的相关部分:

  <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>

我想复制$ {basedir} / src / main / resources文件夹中的所有资源(递归)。任何帮助/建议都非常感谢。

注意:我使用Apache Maven 3.3.9。并且还尝试清理我的〜/ .m2 /存储库中的所有内容并再次编译。

0 个答案:

没有答案