javax.comm依存関係をmavenにダウンロードさせるにはどうすればよいですか?
-
24-10-2019 - |
質問
Mavenを使用してHudson Build Serverにプロジェクトを構築するときは、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
----------
私は何が間違っているのですか?
-編集-
私は最終的にJava Comm Libをダウンロードしました オラクル Maven Adminにローカルリポジトリにインストールしてもらいました。 Java Comm libの下の回答が指摘したように、Oracle(およびそれらの前の太陽)からのライセンス制限のために、公開レポでは利用できません。
解決
あなたが見ているなら ここ, 、「公式」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>
つまり、自分でライブラリをダウンロードする必要があります(URLは <downloadUrl>
タグ)、そして ローカルリポジトリにインストールします (またはさらに良いことに、エンタープライズリポジトリに展開します)。
これは、いくつかのライブラリ(Oracle JDBCドライバーが別の例です)で時々起こります。
他のヒント
JARは、おそらくライセンスの理由から、公開リポジトリでは利用できません。
ダウンロードしてください 通信API 使用して展開します
mvn deploy:deploy-file -DgroupId=javax.comm -DartifactId=comm \
-Dversion=2.0.3 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] \
-DrepositoryId=[id]
実際、メイベンは公開レポでそれを見つけません...
情報]リソースを見つけることができない 'javax.comm:comm:jar:2.0.3'リポジトリjava.netリポジトリ(http://download.java.net/maven/2)... [情報]見つけることができないリソース 'javax.comm:comm:jar:2.0.3'リポジトリセントラル(http://repo1.maven.org/maven2)
任意のソースからダウンロードして、ローカルリポジトリにインストールする必要があります。
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]
ライセンスの制限のため、javax.commパッケージは公開リポジトリで利用できません。さらにdetaisについてはこちらをご覧ください。
http://repo1.maven.org/maven2/javax/comm/comm/2.0.3/comm-2.0.3.pom
POMは、ダウンロードURLも提供します。提供されたリンクを使用して、JARをダウンロードする必要があります。
http://www.sun.com/download/products.xml?id=43208d3d
そしてそれを入れます」/javax/comm/comm/2.0.3/
「会社のリポジトリサーバーでは、Artifactoryのようなサーバーは、このためにWebフロンテンドを提供します。
リポジトリサーバーを持っていない場合は、 .m2/repository
ホームフォルダのディレクトリ。ディレクトリを作成します」/javax/comm/comm/2.0.3/
「このフォルダーにある最初のリンクとダウンロードされたjarからPOMを配置します。しかし、これはローカルマシンでのみ機能します。
また、ソースコントロールにアーティファクトを追加し、説明されているようにビルドの前にMaven-Install-Pluginを使用してローカリーをインストールすることもできます ここ.