我正在使用带有 m2e 的 Eclipse Indigo(它连接到 Maven 3.0.3 的外部二进制文件)。
现在,我的应用程序的预期结构如下:
Company-parent
--Project-parent
----Module1
----Module2
----ModuleN
我设置了我的 pom,使得 Company-parent 是 Project-parent 的项目,而 Project-parent 是所有模块的父级。公司母公司和项目母公司似乎没问题。两者都是包装类型 POM。
第三个层次是我开始遇到问题的地方。即使定义了最简单的模块项目,我也会遇到各种 Maven 错误和各种奇怪的行为。
公司母公司:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.scoresecret</groupId>
<artifactId>scs-global-parent</artifactId>
<version>1</version>
<packaging>pom</packaging>
</project>
项目父:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>scs-global-parent</artifactId>
<groupId>com.scoresecret</groupId>
<version>1</version>
</parent>
<artifactId>scs-model-parent</artifactId>
<groupId>com.scoresecret.model</groupId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>scs-model-core</module>
</modules>
</project>
模块pom:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>scs-model-parent</artifactId>
<groupId>com.scoresecret.model</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>scs-model-core</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
我不能做“Maven -> 更新项目配置”,因为当我这样做的时候,我得到了这个错误:
Failure to find org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 in https://my.archiva.location/archiva/repository/internal was cached in the local repository, resolution will not be reattempted until the update interval of scs.internal has elapsed or updates are forced pom.xml /scs-model-core line 1 Maven Configuration Problem
我收到的其他一些错误:
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 pom.xml /scs-model-core line 1 Maven Build Problem
还收到有关 m2e 忽略模块中我的插件目标之一(来自公司级别的 pom)的错误。我在这里遗漏了一些明显的东西吗?帮助!
谢谢 :)