我的項目包括三個子項目,和我的父POM的樣子:如何依靠這個Maven項目
<groupId>com.bwort.core</groupId>
<artifactId>bwort</artifactId>
<packaging>pom</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>bwort</name>
<modules>
<module>proj1</module>
<module>proj2</module>
<module>proj3</module>
</modules>
現在我的項目需要依賴於以下項目,其中包括三個子項目,與父母pom。特別是,它已經擁有如下父: https://github.com/cmusphinx/sphinx4/blob/master/pom.xml
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<groupId>edu.cmu.sphinx</groupId>
<artifactId>sphinx4-parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
我的問題是,我該如何申報我的父POM文件的依賴?我可以添加其他模塊到我的父POM:
<module>sphinx4</module>
但由於該庫中已經定義了自己的父母「OSS父」,那我怎麼才能讓我的父POM作爲其父?
我的項目依賴於此項目的正確方法是什麼?謝謝。
EDITTED:我的pom.xml
<project >
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.bwort.core</groupId>
<artifactId>bwort</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>wikipedia</artifactId>
<packaging>jar</packaging>
<repositories>
<repository>
<id>snapshots-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>edu.cmu.sphinx</groupId>
<artifactId>sphinx4-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>edu.cmu.sphinx</groupId>
<artifactId>sphinx4-data</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
請告訴我,如果這能幫助你 - > HTTP:// stackoverflow.com/questions/13487075/is-cmu-sphinx-available-via-maven –
這絕對有幫助。但是在版本庫URL和依賴項之後,我收到了這個「Missing artifact edu.cmu.sphinx:sphinx4-data:jar:1.0-SNAPSHOT」。我正在使用我自己的連接庫。 – user697911
請檢查這個罐子是否存在於你的連接點上。如果不存在,請按照Iker Aguayo給出的上述鏈接中的說明在pom.xml中指定它的存儲庫。 – asg