NoModuleFileException: 模块的文件不存在,具有 URI:

huangapple go评论80阅读模式
英文:

NoModuleFileException: File does not exist for module having uri

问题

我正在在 WebSphere 上部署一个 J2EE 项目,我已经在 IntelliJ 中设置了 artifacts、ear 等。这是一个多模块的 Maven 项目,在我意外修改了 IntelliJ 中的一些设置后,它之前一直正常运行。

可能的原因是什么?哪些 IntelliJ 的设置可能会影响到这个?我已经尝试过检查 pom 文件,但它们看起来都没问题,而且在出现问题之前我没有修改过它们。

错误信息是:

模块元素的 URI 为 namefile.war 的文件不存在。
英文:

I am deploying a J2ee project on websphere and I have set up artifacts,ear etc. with intelliJ.
It is a multi module maven project and was working fine till I have accidentally modified some set up in intelliJ.

What can be the reason? What intelliJ setting can influence this?I have tried to investigate pom but they looks fine and I haven not modified them before the issue.

The error is:

A file does not exist for module element having uri: namefile.war

答案1

得分: 1

如果您的“war”文件有快照更改,请将您的ear插件更改为在文件名中跳过版本,如下所示:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-ear-plugin</artifactId>
    <configuration>
        <version>6</version>
        <fileNameMapping>no-version</fileNameMapping>
    </configuration>
</plugin>
英文:

If your war has snapshot change your ear plugin to skip versioning in the file name like this:

        &lt;plugin&gt;
            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
            &lt;artifactId&gt;maven-ear-plugin&lt;/artifactId&gt;
            &lt;configuration&gt;
                &lt;version&gt;6&lt;/version&gt;
                &lt;fileNameMapping&gt;no-version&lt;/fileNameMapping&gt;
            &lt;/configuration&gt;
        &lt;/plugin&gt;

huangapple
  • 本文由 发表于 2020年9月11日 20:40:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/63847296.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定