无法执行目标org.apache.maven.plugins:maven-war-plugin:2.1:war - 无法复制资源

时间:2013-07-16 20:35:10

标签: eclipse maven ubuntu

我有一个多模块项目,我正在尝试在我的Ubuntu 12.04 LTS的Eclipse Juno中导入。 (我已经在Windows 7上成功完成了它。)

我的项目有六个模块,前四个模块已成功从SVN存储库导入并使用Maven 3.0.5构建,但是当我尝试构建第五个名为core时,我收到以下错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1:war (default-war) on project core: Could not copy resource [/opt/workspace/core/target\preassembly]: File /opt/workspace/core/target\preassembly/scripts/Mask.js does not exist -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

如错误所示,看起来Maven找不到要复制文件/opt/workspace/core/target\preassembly的目录/opt/workspace/core/target\preassembly/scripts/Mask.js

但是,这个目录确实存在,文件Mask.js就在那里。对我来说很奇怪的是\目录之后的反斜杠target而不是公共栏/。但我不知道这是否是一个问题以及如何解决这个问题,我花了两天的时间研究互联网,但不幸的是我什么都没发现。

这是父项目pom.xml的maven-war-plugin配置部分,其中出现反斜杠

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.1</version>
                    <configuration>
                        <webResources>
                            <resource>
                                <directory>${project.build.directory}\preassembly</directory>
                            </resource>
                        </webResources>
                    </configuration>
                </plugin>

我还检查了Ubuntu上目录的所有者,并且所有内容都指的是处理前四个模块的所有者。

正如我上面所说,相同版本的eclipse,svn和maven在Windows上运行良好。

有没有人遇到过这个问题?非常感谢你。

1 个答案:

答案 0 :(得分:0)

我正在使用angular 8,并将代码更新为angular 9,然后在构建过程中遇到了相同的问题。对我来说,clean build解决了该问题。您可以尝试clean build,希望对您有所帮助。

相关问题