2016-12-28 3 views
1

zipファイルを開くにjarファイル・エラーの読み込みエラー、私はこれらのプロパティを持つX-モジュールを持っている:MVNコンパイルエラー:

モジュール名:X-データモデル

これはのpom.xml

の一部であり、
<groupId>com.x.datamodel</groupId> 
<artifactId>x</artifactId> 
<version>1.0</version> 
<packaging>jar</packaging> 

私は、このコマンドラインを使用してローカルリポジトリにプロジェクトをインストールする必要があり:

mvn install:install-file -Dfile=/Users/me/Documents/Projects/x-datamodel/target/classes/x-datamodel.jar -DgroupId=com.x.datamodel -DgeneratePom=true -DlocalRepositoryPath=/Users/me/Documents/Projects/me-repository -DcreateChecksum=true -DartifactId=x -Dversion={1.0} -Dpackaging=jar 

、コメントを追加しましたbitbucketのプロジェクト。

モジュールxを別のプロジェクトyに統合しようとしています。ここ

Yさんのpom.xml

<dependency> 
    <groupId>com.x.datamodel</groupId> 
    <artifactId>x</artifactId> 
    <version>${x.version}</version> 
</dependency> 

<repositories> 
    <repository> 
     <id>me-repository</id> 
     <url>https://bitbucket.org/me/me-repository/src/master</url> 
    </repository> 
</repositories> 

の一部私はプロジェクトyにモジュールxのいくつかのクラスをインポートすることができますが、私はyのプロジェクトをビルドするとき、私はこのエラーを取得:

[ERROR] COMPILATION ERROR : 
[INFO] ------------------------------------------------------------- 
[ERROR] error reading /Users/me/.m2/repository/com/x/datamodel/x/1.0/x-1.0.jar; error in opening zip file 
[ERROR] error reading /Users/me/.m2/repository/com/x/datamodel/x/1.0/x-1.0.jar; error in opening zip file 
[ERROR] /Users/me/Documents/Projects/y/src/main/java/com/y/server/serviceImpl/UserServiceImpl.java:[3,32] package com.x.datamodel.model does not exist 
[ERROR] /Users/me/Documents/Projects/y/src/main/java/com/y/server/serviceImpl/UserServiceImpl.java:[18,12] cannot find symbol 
    symbol: class User 
    location: class com.y.server.serviceImpl.UserServiceImpl 
[ERROR] /Users/me/Documents/Projects/y/src/main/java/com/y/server/security/CustomUserDetailsService.java:[3,32] package com.x.datamodel.model does not exist 
[INFO] 16 errors 
[INFO] ------------------------------------------------------------- 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 01:56 min 
[INFO] Finished at: 2016-12-28T15:51:05+01:00 
[INFO] Final Memory: 29M/209M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project y: Compilation failure: Compilation failure: 
[ERROR] error reading /Users/me/.m2/repository/com/x/datamodel/x/1.0/x-1.0.jar; error in opening zip file 
[ERROR] error reading /Users/me/.m2/repository/com/x/datamodel/x/1.0/x-1.0.jar; error in opening zip file 
[ERROR] /Users/me/Documents/Projects/y/src/main/java/com/y/server/serviceImpl/UserServiceImpl.java:[3,32] package com.x.datamodel.model does not exist 
[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/MojoFailureException 

リポジトリをインストールした後、私は、このパスにライブラリを持っている:

.m2/repository/com/x/datamodel/x/1.0/x-1.0.jar 

なぜ:

.m2/repository/com/x-datamodel/x/1.0/x-1.0.jar 
+0

'-Dversion = {1.0}'は '-Dversion = 1.0'でしたか? – yshavit

+0

は問題を解決しませんでした。同じ問題 – emoleumassi

+0

指定されたURLに 'jar'が含まれていますか?アクセスしようとしているwherrからリモートに展開しましたか? – nullpointer

答えて

0

ファイルが壊れていると思う傾向があります。それを削除してもう一度ダウンロードしてみてください。

+0

私はそれを行います。私はすべてのutil .m2/repository /を削除し、mvn clean installを実行します。しかし同じ問題 – emoleumassi

+0

jarファイルのチェックサムがある場合は、ダウンロードしたファイルのチェックサムと比較してみてください。また、 'jar tvf'を使ってjarファイルの内容をサニティチェックとして表示することもできます。がんばろう! – leeyuiwah