我正在使用Maven构建我的项目。我的maven版本是apache-maven-3.0.4。我正在使用Eclipse Luna。当我试图构建我的项目时,我得到了以下错误
[错误]无法执行目标org.apache.maven.plugins:maven-resource-plugin:2.7:OrionCommunity项目上的资源(默认资源):标记无效-
以下是我运行mvn clean install时的堆栈跟踪-X
:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:53.295s
[INFO] Finished at: Thu Oct 09 20:00:26 IST 2014
[INFO] Final Memory: 9M/25M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.7:resources (default-resources) on project OrionCommunity: Mark invalid -> [Hel
p 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.7:resources (default-resources)
on project OrionCommunity: Mark invalid
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
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:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Mark invalid
at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo.java:306)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.apache.maven.shared.filtering.MavenFilteringException: Mark invalid
at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile(DefaultMavenFileFilter.java:129)
at org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources(DefaultMavenResourcesFiltering.java:264)
at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo.java:300)
... 21 more
Caused by: java.io.IOException: Mark invalid
at java.io.BufferedReader.reset(BufferedReader.java:485)
at org.apache.maven.shared.filtering.MultiDelimiterInterpolatorFilterReaderLineEnding.read(MultiDelimiterInterpolatorFilterReaderLineEnding.java:416)
at org.apache.maven.shared.filtering.MultiDelimiterInterpolatorFilterReaderLineEnding.read(MultiDelimiterInterpolatorFilterReaderLineEnding.java:205)
at java.io.Reader.read(Reader.java:123)
at org.apache.maven.shared.utils.io.IOUtil.copy(IOUtil.java:181)
at org.apache.maven.shared.utils.io.IOUtil.copy(IOUtil.java:168)
at org.apache.maven.shared.utils.io.FileUtils.copyFile(FileUtils.java:1856)
at org.apache.maven.shared.utils.io.FileUtils.copyFile(FileUtils.java:1804)
at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile(DefaultMavenFileFilter.java:114)
... 23 more
我的maven存储库在D:/mavenrepo下。我已经完全删除了repo中的所有jar,并进行了干净的安装。但我还是犯了这个错误。
我也有这个问题,因为我过滤 /src/main/resources,忘记了我已经添加了密钥存储(*. jks)二进制文件到这个目录。
添加一个包含二进制文件排除项的“资源”块,您的问题可能会得到解决。
<build>
<finalName>somename</finalName>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>false</filtering>
</testResource>
</testResources>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>*.jks</exclude>
<exclude>*.png</exclude>
</excludes>
</resource>
</resources>
...
为我删除此工作:
<filtering>true</filtering>
我猜是这个过滤bug造成的
与:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
</plugin>
得到了以下例外:
...
Caused by: org.apache.maven.plugin.MojoExecutionException: Mark invalid
at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo.java:306)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 25 more
Caused by: org.apache.maven.shared.filtering.MavenFilteringException: Mark invalid
at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile(DefaultMavenFileFilter.java:129)
at org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources(DefaultMavenResourcesFiltering.java:264)
at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo.java:300)
... 27 more
Caused by: java.io.IOException: Mark invalid
at java.io.BufferedReader.reset(BufferedReader.java:505)
at org.apache.maven.shared.filtering.MultiDelimiterInterpolatorFilterReaderLineEnding.read(MultiDelimiterInterpolatorFilterReaderLineEnding.java:416)
at org.apache.maven.shared.filtering.MultiDelimiterInterpolatorFilterReaderLineEnding.read(MultiDelimiterInterpolatorFilterReaderLineEnding.java:205)
at java.io.Reader.read(Reader.java:140)
at org.apache.maven.shared.utils.io.IOUtil.copy(IOUtil.java:181)
at org.apache.maven.shared.utils.io.IOUtil.copy(IOUtil.java:168)
at org.apache.maven.shared.utils.io.FileUtils.copyFile(FileUtils.java:1856)
at org.apache.maven.shared.utils.io.FileUtils.copyFile(FileUtils.java:1804)
at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile(DefaultMavenFileFilter.java:114)
... 29 more
在添加maven filtering 1.3之后,它就消失了:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-filtering</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
</plugin>
我不知道有什么问题。试图为一个大学项目安装maven。我已经按照这里的指示安装了maven。图片环境变量,cmd中的maven版本。我还试图删除. m2文件。当我试图在InteliJ中的插件上安装maven时,我收到消息:“进程终止”,没有额外的信息。然后我试图用mvn干净安装在终端上安装,我得到了这个。 然后我运行了“mvn clean install-X”以获取更多信息,它还提供了这一信息。
有关错误和可能的解决方案的详细信息,请阅读以下文章:[帮助1]http://cwiki.apache.org/confluence/display/maven/mojoExecutionException
当我用依赖项构建项目时,它给出了这个错误。 提前致谢
尝试使用Maven3生成失败,我无法了解原因。使用以下命令调用站点生成: 结果如下: 我的pom.xml:
我正在尝试用eclipse和Maven设置一个Dicord Bot。问题是,我每次都会出现2个错误,似乎没有什么工作。 我尝试了这篇帖子中的所有内容:Maven:未能执行目标组织。阿帕奇。专家插件:maven资源插件:2.7:资源 这是错误消息: 和 Eclipse在末尾显示一个错误:
我尝试通过命令提示符执行以下命令: 当我执行上述命令时,我收到以下错误。 补充一点:我不使用pom.xml文件,jar文件保存在D:/xx/xxx.So我导航到文件夹并执行了上述命令。确切的问题是什么,我如何纠正这个问题。我对Maven很陌生