在使用 Maven 在我们的 Hudson 构建服务器上构建我的项目时,我需要 javax.comm 库。在我的项目 pom.xml 文件中,我有这样的依赖项:
<dependency>
<groupId>javax.comm</groupId>
<artifactId>comm</artifactId>
<version>2.0.3</version>
</dependency>
我还在某处读到,如果我包含存储库,我会对 javax lib 有更好的运气:
<repository>
<id>java.net repository</id>
<url>http://download.java.net/maven/2</url>
</repository>
我做了。我的 pom.xml 的其余部分非常标准且简约。
当我尝试在构建服务器上构建时,我得到:
Downloading: [company repo]/content/groups/public//javax/comm/comm/2.0.3/comm-2.0.3.jar
[INFO] Unable to find resource 'javax.comm:comm:jar:2.0.3' in repository java.net repository (http://download.java.net/maven/2)
Downloading: [company repo]/content/groups/public//javax/comm/comm/2.0.3/comm-2.0.3.jar
[INFO] Unable to find resource 'javax.comm:comm:jar:2.0.3' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) javax.comm:comm:jar:2.0.3
Try downloading the file manually from:
http://www.sun.com/download/products.xml?id=43208d3d
Then, install it using the command:
mvn install:install-file -DgroupId=javax.comm -DartifactId=comm -Dversion=2.0.3 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=javax.comm -DartifactId=comm -Dversion=2.0.3 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) com.siriusit.fisherysolution.inmcsim:InmCSim:jar:1.0-SNAPSHOT
2) javax.comm:comm:jar:2.0.3
----------
我究竟做错了什么?
-编辑-
我最终从Oracle下载了 java comm 库,并让我们的 Maven 管理员将它安装在我们的本地存储库中。正如下面的答案所指出的,由于 Oracle(以及之前的 Sun)的许可限制,公共存储库中不提供 java comm lib。