2017-09-18 4 views
0

私はこのpom.xmlを使ってTdkUtilsと呼ばれるEclipseのmavenプロジェクトを持っています: これはutilsプロジェクトです。ですから、私はjarを作成してリポジトリに入れ、別のプロジェクトでそれを使用したいと思います。サードパーティのJARをインストール

... 
<groupId>com.tdk</groupId> 
    <artifactId>tdkUtils</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>jar</packaging> 

    <name>tdkUtils</name> 
... 

しかし、プラグインをインストールするときに、私はこれらのエラーを得た:

MacBook-Pro-de-nunito:tdkUtils nunito$ mvn install:install-file -Dfile=target/tdkUtils-0.0.1-SNAPSHOT.jar 
[INFO] Scanning for projects... 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building tdkUtils 0.0.1-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ tdkUtils --- 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 0.353 s 
[INFO] Finished at: 2017-09-18T11:29:58+02:00 
[INFO] Final Memory: 9M/309M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project tdkUtils: The artifact information is incomplete or not valid: 
[ERROR] [0] 'groupId' is missing. 
[ERROR] [1] 'artifactId' is missing. 
[ERROR] [2] 'packaging' is missing. 
[ERROR] [3] 'version' is missing. 
[ERROR] -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 
+0

あなたはあなたのpom.xmlの構文が正しいことを確認していますか? –

答えて

3

あなただけのutil pom.xmlファイルと同じディレクトリ内mvn installしばらく実行した場合は、Mavenのは、ローカルリポジトリにjarファイルをインストールしますユーザー。

その後、他のプロジェクトの同じユーザーがjarファイルを使用できます。

0

あなたはこのようのpom.xmlせずにローカルレポにjarファイルをインストールすることができます。 mvn install:install-file -Dfile=target/tdkUtils-0.0.1-SNAPSHOT.jar -DgroupId=com.tdk -DartifactId=tdkUtils -Dversion=0.0.1-SNAPSHOT -Dpackaging=jar

関連する問題