在我们的Hudson build服务器上使用javax.comm构建我的项目时,我需要Maven库。在我的项目pom.xml文件中,我有如下依赖项:
<dependency>
<groupId>javax.comm</groupId>
<artifactId>comm</artifactId>
<version>2.0.3</version>
</dependency>我还在某个地方读到,如果我包含存储库,我会更幸运地使用javax库:
<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 lib,并让我们的Maven管理员将其安装在本地存储库中。正如下面的回答所指出的,由于甲骨文(以及之前的Sun )的许可限制,java comm lib在公共回购上不可用。
发布于 2011-03-15 18:51:51
如果您在“官方”Maven2存储库中查看here,您将在您的库的pom.xml文件中看到:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>javax.comm</groupId>
<artifactId>comm</artifactId>
<version>2.0.3</version>
<name>Java Communications API</name>
<description>
The Java Communications API is a Java extension that facilitates developing platform-independent
communications applications for technologies such as Smart Cards, embedded systems, and point-of-sale
devices, financial services devices, fax, modems, display terminals, and robotic equipment.
</description>
<url>http://java.sun.com/products/javacomm/</url>
<distributionManagement>
<downloadUrl>http://www.sun.com/download/products.xml?id=43208d3d</downloadUrl>
</distributionManagement>
<dependencies></dependencies>
</project>这意味着您应该自己下载库(网址在<downloadUrl>标记中提供),然后使用install it on your local repository (或者更好的方法是将其部署到企业存储库)。
这种情况有时发生在一些库( Oracle JDBC驱动程序是另一个例子)上,这些库不能直接下载,本质上是因为特定的许可证……
发布于 2011-03-15 18:56:17
jar在公共存储库中不可用,可能是由于许可的原因。
下载Communication API并使用以下命令部署它
mvn deploy:deploy-file -DgroupId=javax.comm -DartifactId=comm \
-Dversion=2.0.3 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] \
-DrepositoryId=[id]发布于 2011-03-15 18:52:24
实际上maven在公共回收站上找不到它...
信息在存储库java.net存储库(http://download.java.net/maven/2)中找不到资源'javax.comm:comm:jar:2.0.3‘...信息在存储库中心(http://repo1.maven.org/maven2)中找不到资源'javax.comm:comm:jar:2.0.3‘
您必须从任何来源下载它,并将其安装在本地存储库中:
mvn install:install-file -DgroupId=javax.comm -DartifactId=comm -Dversion=2.0.3 -Dpackaging=jar -Dfile=/path/to/file或者将其部署到您的公司存储库(如果您有):
mvn deploy:deploy-file -DgroupId=javax.comm -DartifactId=comm -Dversion=2.0.3 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] https://stackoverflow.com/questions/5310477
复制相似问题