2017-01-05 21 views
0

pomを使用してローカルのネクサスリポジトリにzipファイルをアップロードしました。正しくアップロードされたようです。私はダウンロードをしようとすると、私が取得Maven:zipファイルをアップロードしてnexusリポジトリにダウンロード

<project> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.foo</groupId> 

    <artifactId>projectusingofficestuff</artifactId> 
    <version>1.0.0-SNAPSHOT</version> 

    <build> 
    <plugins> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-dependency-plugin</artifactId> 
     <executions> 
      <execution> 
      <id>copy-dependency</id> 
      <phase>compile</phase> 
      <goals> 
       <goal>unpack</goal> 
      </goals> 
      <configuration> 
       <artifactItems> 
       <artifactItem> 
        <groupId>com.foo</groupId> 
        <artifactId>officestuff</artifactId> 
        <type>zip</type> 
        <version>1.0.0-RELEASE</version> 
        <overWrite>true</overWrite> 
        <outputDirectory>target/unpacked</outputDirectory> 
       </artifactItem> 
       </artifactItems> 
      </configuration> 
      </execution> 
     </executions> 
     </plugin> 
    </plugins> 
    </build> 
</project> 

[DEBUG] (s) remoteRepos = [  id: nexus 
     url: http://repository/nexus/repository/maven-public 
    layout: default 
snapshots: [enabled => false, update => daily] 
releases: [enabled => true, update => daily] 
] 
[DEBUG] (f) silent = false 
[DEBUG] -- end configuration -- 
[INFO] Configured Artifact: com.foo:officestuff:1.0.0-RELEASE:zip 
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://repository/nexus/repository/maven-public as mike 
Downloading: http://repository/nexus/repository/maven-public/com/foo/officestuff/1.0.0-RELEASE/officestuff-1.0.0-RELEASE.zip 
[DEBUG] Writing resolution tracking file /home/mike/.m2/repository/com/foo/officestuff/1.0.0-RELEASE/officestuff-1.0.0-RELEASE.zip.lastUpdated 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 0.763s 
[INFO] Finished at: Wed Jan 04 16:13:20 EST 2017 
[INFO] Final Memory: 20M/962M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack (copy-dependency) on project projectusingofficestuff: Unable to find artifact. Could not find artifact com.foo:officestuff:zip:1.0.0-RELEASE in nexus (http://repository/nexus/repository/maven-public) 

私が直接使用してリポジトリを検索する場合: http://repository/nexus/repository/maven-public/com/foo/officestuff/1.0.0-RELEASE/officestuff-1.0.0-RELEASE.zip?describe

はそれが見つけた私は、使用して別のプロジェクトでそれをダウンロードしようアーティファクトを返し、正しい応答のように見えるものを返します。なぜMavenビルドがそれを見つけられないのでしょうか?

+0

あなたのプロジェクトディレクトリに 'mvn org.apache.maven.plugins:maven-dependency-plugin:3.0.0:unpack'を実行してみることができますか古いバージョンをチェックする場合にはバグがあります。それはおそらく不正確な段階になる。 – nullpointer

+0

まず、バージョン1.0.0-RELEASEが正しいことを私は疑います。通常、リリース版は '1.0.0'のようになります。さらに、pluginManagementを使ってプラグインのバージョンを定義したように見えました。あなたがmaven-dependency-pluginの非常に古いバージョンを使用していたようです。 – khmarbaise

答えて

0

ありがとうございました。私はそれが働くように見えます。私はもともと

Maven - Depend on assembled zip

アップロード時には、アセンブリファイル名(私の場合はbin.xml)はアーティファクト名に付加して表示されませんでした別のstackoverflowの問題の答えの手がかりを見つけました。アーティファクトを見つけるためにダウンロードするには、<classifier>bin</classifier> をアーティファクトの依存ブロックに追加する必要がありました。

関連する問題