2

我们有一个带有 Git 子模块的 Maven 项目contrib/holo-everywherecontrib/ActionBarSherlock

根 pom.xml 描述这样的模块:

<module>contrib/holo-everywhere/resbuilder</module>
<module>contrib/holo-everywhere/library</module>
<module>contrib/holo-everywhere/addons/preferences</module>
<module>contrib/holo-everywhere/addons/slidingmenu</module>
<module>contrib/ActionBarSherlock/actionbarsherlock</module>

从控制台构建的 maven 可以完美运行,但是当项目被导入 IntelliJ IDEA 时会发生错误。

每个 pom.xmlcontrib/ActionBarSherlock/actionbarsherlock/pom.xml都无法从其项目父 pom 中的依赖管理中解析依赖版本。在这种情况下contrib/ActionBarSherlock/pom.xml

contrib/ActionBarSherlock/pom.xml

 <dependency>
    <groupId>android</groupId>
    <artifactId>android</artifactId>
    <version>${android.version}</version>
  </dependency>

contrib/ActionBarSherlock/actionbarsherlock/pom.xml

 <dependency>
    <groupId>android</groupId>
    <artifactId>android</artifactId>
    <scope>provided</scope>
 </dependency>

这只发生在contrib目录中的这些子模块上。我们有依赖于父 pom 的 maven 模块——它们的依赖关系得到了很好的解决。

这是一个错误还是我应该以其他方式导入项目?

4

1 回答 1

1

<relativePath>父母pom.xml失踪了。

于 2013-04-18T14:07:21.413 回答