错误:Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.7:resources (default-res

Posted maigy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了错误:Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.7:resources (default-res相关的知识,希望对你有一定的参考价值。

详细错误:

 1 Mark invalid (org.apache.maven.plugins:maven-resources-plugin:2.7:resources:default-resources:process-resources)
 2 
 3 org.apache.maven.plugin.MojoExecutionException: Mark invalid
 4     at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo.java:306)
 5     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
 6     at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331)
 7     at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362)
 8     at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1)
 9     at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
10     at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
11     at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1360)
12     at org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:52)
13     at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:137)
14     at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:172)
15     at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1)
16     at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1$1.call(MavenBuilder.java:115)
17     at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
18     at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
19     at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:105)
20     at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
21     at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
22     at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
23     at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:86)
24     at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200)
25     at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
26     at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
27     at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
28     at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
29     at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
30     at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
31     at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
32     at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
33     at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
34     at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:142)
35     at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:232)
36     at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
37 Caused by: org.apache.maven.shared.filtering.MavenFilteringException: Mark invalid
38     at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile(DefaultMavenFileFilter.java:129)
39     at org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources(DefaultMavenResourcesFiltering.java:264)
40     at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo.java:300)
41     ... 32 more
42 Caused by: java.io.IOException: Mark invalid
43     at java.io.BufferedReader.reset(BufferedReader.java:512)
44     at org.apache.maven.shared.filtering.MultiDelimiterInterpolatorFilterReaderLineEnding.read(MultiDelimiterInterpolatorFilterReaderLineEnding.java:416)
45     at org.apache.maven.shared.filtering.MultiDelimiterInterpolatorFilterReaderLineEnding.read(MultiDelimiterInterpolatorFilterReaderLineEnding.java:205)
46     at java.io.Reader.read(Reader.java:140)
47     at org.apache.maven.shared.utils.io.IOUtil.copy(IOUtil.java:181)
48     at org.apache.maven.shared.utils.io.IOUtil.copy(IOUtil.java:168)
49     at org.apache.maven.shared.utils.io.FileUtils.copyFile(FileUtils.java:1856)
50     at org.apache.maven.shared.utils.io.FileUtils.copyFile(FileUtils.java:1804)
51     at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile(DefaultMavenFileFilter.java:114)
52     ... 34 more

解决方案:在 pom.xml 文件里添加如下内容:

 1 <plugin>
 2    <groupId>org.apache.maven.plugins</groupId>
 3        <artifactId>maven-resources-plugin</artifactId>
 4        <version>2.7</version>
 5        <dependencies>
 6              <dependency>
 7                   <groupId>org.apache.maven.shared</groupId>
 8                   <artifactId>maven-filtering</artifactId>
 9                   <version>1.3</version>
10              </dependency>
11       </dependencies>
12 </plugin>

 

以上是关于错误:Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.7:resources (default-res的主要内容,如果未能解决你的问题,请参考以下文章

错误:Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.7:resources (default-res

Idea创建Maven项目时出现Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1错误

maven打包工程出现错误 Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test(示例代码

maven打包错误: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources(代码

IDEA报错Failed to execute goal

[ERROR ]Failed to execute goal org.codehaus.mojo:flatten-maven-plugin:1.1.0:flatten (flatten) on pro