mavenでコマンドラインからアーティファクトをダウンロードしようとしています。アーティファクトの基本バージョンだけは知っていますが、ネクサスリポジトリには個別のタイムスタンプがあります。例えばMaven依存関係:ベースバージョンのコピーアーティファクト
:
com.mycompany.subject:any-artifact:3.0.0-SNAPSHOT:war:plugins
アーチファクトはネクサスリポジトリにcom.mycompany.subject:any-artifact:3.0.0-20161212.140040-1:war:plugins
次の座標を有します。
私はこのようなアーティファクトをダウンロードしたい:
mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:copy -Dartifact=com.mycompany.subject:any-artifact:3.0.0-SNAPSHOT:war:plugins -DoutputDirectory=./my-tmp
私は、マニュアルで-Dmdep.useBaseVersion
オプションを発見したが、これは唯一の基本バージョンでダウンロードされたアーティファクトを節約できます。
EDIT:
問題は、私は、例えばアーチファクトの基本バージョンを知っていること、です3.0.0-SNAPSHOTと上記のようなnexusからダウンロードしようとすると、nexusのバージョンにタイムスタンプが付いているので失敗します。
のmaven-のmetadata.xml:
<metadata>
<groupId>com.mycompany.subject</groupId>
<artifactId>any-artifact</artifactId>
<versioning>
<versions>
<version>3.0.0-SNAPSHOT</version>
</versions>
<lastUpdated>20161214160043</lastUpdated>
</versioning>
</metadata>
エラー・スタックトレース:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.319 s
[INFO] Finished at: 2016-12-19T15:04:06+01:00
[INFO] Final Memory: 16M/298M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.10:copy (default-cli) on project standalone-pom: Unable to find artifact. Could not find artifact com.mycompany.subject:any-artifact:3.0.0-SNAPSHOT in <remote-repository-id> (https://<nexus-repo-url>/nexus/repository/<specified-repository>)
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId ...
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId ...
[ERROR]
[ERROR]
[ERROR] com.mycompany.subject:any-artifact:3.0.0-SNAPSHOT
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] remote-repository-id (https://<nexus-repo-url>/nexus/repository/<specified-repository>),
[ERROR] -> [Help 1]
現在何が間違っていますか?結果として何をお探しですか? – Tunaki
私の編集plsを見てください。バージョンにはリポジトリにタイムスタンプがありますが、ベースバージョンのアーティファクトをダウンロードしたいと思います。 – Oni1
これは問題を起こさないはずです。アーティファクトマネージャは、「3.0.0-SNAPSHOT」を理解し、最新のタイムスタンプ付きスナップショットをダウンロードする必要があります。 Nexusの設定が間違っている可能性があります。 'http:// yourNexusUrl/com/mycompany/subject/any-artifact'の' maven-metadata.xml'ファイルを確認してください。それはどのように見えるのですか? – Tunaki