java - 用於執行目標的Maven:Failed apache maven插件:maven資源插件:2.7: 資源

  显示原文与译文双语对照的内容
108 3

我正在使用 Maven 構建我的項目。 我的Maven 版本是 apache-maven-3.0.4. 我使用 Eclipse Luna 。當我嘗試生成項目時,出現以下錯誤

[ERROR]: 。apache: maven-resources-plugin: 2: 在項目上資源( 默認資源): 標記無效-> [Help 1 ] 。

下面是運行 mvn clean安裝 -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 中的所有 jars 並進行了乾淨的安裝。 但我還是有這個錯誤。

时间: 原作者:

66 5

使用:


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



原作者:
...