2016-03-27 11 views
1

Maven CentralにはないJARファイルで定義されたカスタムAntタスクを実行しようとしています。maven-antrun-pluginのプライベートリポジトリからカスタムAntタスクをリクエストする

<repositories> 
     <repository> 
      <id>repository.com</id> 
      <name>repository.com</name> 
      <url>http://repository.com/maven/</url> 
     </repository> 
    </repositories> 

今すぐ質問

ドキュメントの状態であるがに

リポジトリもprefectly発見されている他の「プライベート」のjarファイルを、ホストのようなもの、と定義され、 <プラグイン内の依存関係を定義するのは、>セクションのみです.pomファイルの汎用<依存性>内にも依存関係を定義する必要があることがわかりました。

ので、実質的に依存関係の記述を複製し、このような何か、:

<dependencies> 
     <dependency> 
      <groupId>org.bitbucket.infinitekind</groupId> 
      <artifactId>appbundler</artifactId> 
      <version>1.0ea</version> 
     </dependency> 
    </dependencies> 

    <build> 
     <plugins> 
      <plugin> 
       <artifactId>maven-antrun-plugin</artifactId> 
       <version>1.7</version> 
       <executions> 
        <execution> 
         <id>local-install</id> 
         <phase>install</phase> 
         <configuration> 
          <target> 
           <taskdef name="appbundler" onerror="fail" classpathref="maven.plugin.classpath" classname="com.oracle.appbundler.AppBundlerTask"/> 
          </target> 
         </configuration> 
         <goals> 
          <goal>run</goal> 
         </goals> 
        </execution> 
       </executions> 
       <dependencies> 
        <dependency> 
         <groupId>org.bitbucket.infinitekind</groupId> 
         <artifactId>appbundler</artifactId> 
         <version>1.0ea</version> 
        </dependency> 
       </dependencies> 
      </plugin> 
     </plugins> 
    </build> 

が、これは正常な動作ですか私は何かが足りないのですか?

EDIT

これは、依存関係が満たされていない、その後も思えます。私はjarファイルがダウンロードされ、〜/ .m2リポジトリに配置されている(これは一般的なdepenedencyに)はっきり見ることができますが 、antタスクはまだそれを理解していない:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (local-install) on project cmmanager: Execution local-install of goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run failed: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.8 or one of its dependencies could not be resolved: Failure to find org.bitbucket.infinitekind:appbundler:jar:1.0ea in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

答えて

1

まあを、いくつかのより多くの後掘って、私は答えを見つけた。問題は、プラグインの依存関係が、リポジトリー・セクションではなく、pluginRepositoriesセクションで解決されることです。 これで問題は解決します:

<pluginRepositories> 
    <pluginRepository> 
     <id>repository.com</id> 
     <url>http://repository.com/maven/</url> 
    </pluginRepository> 
</pluginRepositories> 
関連する問題