ubuntu 无法执行目标组织,apache.maven,插件:maven-war-插件:2.1:war -无法复制资源

xe55xuns  于 2022-11-28  发布在  Apache
关注(0)|答案(1)|浏览(157)

我有一个多模块项目,我试图导入到我的Ubuntu 12.04 LTS的Eclipse Juno中。(我已经在Windows 7上成功地完成了)。
我的项目有六个模块,前四个模块成功地从SVN Repository导入并使用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目录后面的反斜杠\,而不是一个公共栏/。但我不知道这是否是一个问题,如何解决它,我花了2天的时间在互联网上搜索,但不幸的是,我什么也没有找到。
下面是我的父项目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上运行得很好。
有人遇到过这种问题吗?非常感谢。

n8ghc7c1

n8ghc7c11#

我在做Angular 8的时候,把代码更新到了Angular 9,然后在构建的时候我遇到了同样的问题。对我来说,干净的构建解决了这个问题。你可以试试干净的构建,希望会有帮助。

相关问题