在使用Maven在我们的Hudson构建服务器上构建项目时,我需要javax.comm库.在我的项目pom.xml文件中,我有这样的依赖:
<dependency>
<groupId>javax.comm</groupId>
<artifactId>comm</artifactId>
<version>2.0.3</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我还读到了某个地方,如果我包含了存储库,我会更好地使用javax lib:
<repository>
<id>java.net repository</id>
<url>http://download.java.net/maven/2</url>
</repository>
Run Code Online (Sandbox Code Playgroud)
我做了.我的其他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
----------
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
-编辑-
我最终从Oracle下载了java comm lib ,让我们的Maven管理员将它安装在我们的本地存储库中.正如下面的答案所指出的,由于Oracle(以及之前的Sun)的许可限制,java comm lib在公共存储库中不可用.
Rom*_*las 12
如果您看一下这里,在"官方"Maven 2存储库中,您将在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>
Run Code Online (Sandbox Code Playgroud)
这意味着您应该自己下载库(URL在<downloadUrl>标记中给出),然后将其安装在本地存储库中(甚至更好,将其部署在您的企业存储库中).
有时会出现一些无法直接下载的库(Oracle JDBC驱动程序是另一个示例),这主要是因为特定的许可证......
| 归档时间: |
|
| 查看次数: |
13855 次 |
| 最近记录: |