i has an x-module with the following properties:
module name: x-datamodel
this is part of pom.xml
<groupId>com.x.datamodel</groupId> <artifactId>x</artifactId> <version>1.0</version> <packaging>jar</packaging>
I installed the project in the local repository using this command line:
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
and added the project to the bitbucket.
I am trying to integrate module x into another project y.
here is the y pom.xml part
<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>
I can import some classes of module x into project y, but when I build a y project, I get this error:
[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
after installing the repository, I have a library on this path:
.m2/repository/com/x/datamodel/x/1.0/x-1.0.jar
why not:
.m2/repository/com/x-datamodel/x/1.0/x-1.0.jar
java module maven maven-3
emoleumassi Dec 28 '16 at 15:08 2016-12-28 15:08
source share