1

I'm trying to use JGitflow to create a release for my project. Unfortunately, when I run mvn jgitflow:release-finish, I get the following error:

Unable to find resource 'org.jorlib:jorlib-core:jar:1.0' in repository central (http://repo1.maven.org/maven2)  
[WARNING] The dependency: org.jorlib:jorlib-core:jar:1.0 can't be resolved but has been found in the reactor.

I'm not sure how to resolve this. First I ran: mvn jgitflow:release-start which reported "Build Successfull". The result looks correct:

jkinable@daedalus:~/workspace/javaIDEA/jORLib/jorlib$ git branch -avv
development                07e4c1f [origin/development: ahead 3] updating poms for 1.1-SNAPSHOT development
master                     f3240f9 [origin/master] Updated pom.xml
*release/1.0              f3240f9 Updated pom.xml

Next I ran mvn jgitflow:release-finish which fails. It seems that it tries to download jorlib-core-1.0.jar but that is the file it is supposed to compile. Digging deeper into this, I ran mvn jgitflow:release-finish -e -X > ~/mygitflow.log Here is part of the result:

[INFO] Building JORLib - Parent
[INFO]    task-segment: [jgitflow:release-finish] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[DEBUG] org.jorlib:jorlib:pom:1.0-SNAPSHOT (selected for null)
[DEBUG] org.jorlib:jorlib-core:jar:1.0-SNAPSHOT (selected for null)
[DEBUG]   junit:junit:jar:4.12:test (selected for test)
[DEBUG] Retrieving parent-POM: org.hamcrest:hamcrest-parent:pom:1.3 for project: null:hamcrest-core:jar:null from the repository.
[DEBUG]     org.hamcrest:hamcrest-core:jar:1.3:test (selected for test)
[DEBUG] Retrieving parent-POM: org.jgrapht:jgrapht:pom:0.9.0 for project: null:jgrapht-core:jar:null from the repository.
[DEBUG] Adding managed dependencies for unknown:jgrapht-core
[DEBUG]   org.jgrapht:jgrapht-core:jar:0.9.0
[DEBUG]   org.jgrapht:jgrapht-ext:jar:0.9.0
[DEBUG]   org.jgrapht:jgrapht-demo:jar:0.9.0
[DEBUG]   xmlunit:xmlunit:jar:1.3:test
[DEBUG]   junit:junit:jar:4.10:test
[DEBUG]   org.jgrapht:jgrapht-core:jar:0.9.0:compile (selected for compile)
[DEBUG] Retrieving parent-POM: com.google.guava:guava-parent:pom:14.0.1 for project: null:guava:bundle:null from the repository.
[DEBUG]   com.google.guava:guava:jar:14.0.1:compile (selected for compile)
[DEBUG] Retrieving parent-POM: ch.qos.logback:logback-parent:pom:0.9.28 for project: null:logback-classic:jar:null from the repository.
[DEBUG] Adding managed dependencies for unknown:logback-classic
[DEBUG]   ch.qos.logback:logback-core:jar:0.9.28
[DEBUG]   ch.qos.logback:logback-core:test-jar:tests:0.9.28
[DEBUG]   ch.qos.logback:logback-classic:jar:0.9.28
[DEBUG]   ch.qos.logback:logback-access:jar:0.9.28
[DEBUG]   org.slf4j:slf4j-api:jar:1.6.1
[DEBUG]   janino:janino:jar:2.5.10
[DEBUG]   org.codehaus.groovy:groovy-all:jar:1.7.2
[DEBUG]   javax.mail:mail:jar:1.4
[DEBUG]   dom4j:dom4j:jar:1.6.1
[DEBUG]   hsqldb:hsqldb:jar:1.8.0.7
[DEBUG]   com.h2database:h2:jar:1.2.132
[DEBUG]   postgresql:postgresql:jar:8.4-701.jdbc4
[DEBUG]   mysql:mysql-connector-java:jar:5.1.9
[DEBUG]   org.apache.tomcat:catalina:jar:6.0.20
[DEBUG]   org.mortbay.jetty:jetty:jar:6.1.1
[DEBUG]   org.eclipse.jetty:jetty-server:jar:7.0.1.v20091125
[DEBUG]   org.mortbay.jetty:servlet-api-2.5:jar:6.1.1
[DEBUG]   org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.0
[DEBUG]   javax.servlet:servlet-api:jar:2.5
[DEBUG]   org.scala-lang:scala-library:jar:2.7.7
[DEBUG]   ch.qos.logback:logback-classic:jar:0.9.28:compile (selected for compile)
[DEBUG] Adding managed dependencies for unknown:logback-core
[DEBUG]   ch.qos.logback:logback-core:jar:0.9.28
[DEBUG]   ch.qos.logback:logback-core:test-jar:tests:0.9.28
[DEBUG]   ch.qos.logback:logback-classic:jar:0.9.28
[DEBUG]   ch.qos.logback:logback-access:jar:0.9.28
[DEBUG]   org.slf4j:slf4j-api:jar:1.6.1
[DEBUG]   janino:janino:jar:2.5.10
[DEBUG]   org.codehaus.groovy:groovy-all:jar:1.7.2
[DEBUG]   javax.mail:mail:jar:1.4
[DEBUG]   dom4j:dom4j:jar:1.6.1
[DEBUG]   hsqldb:hsqldb:jar:1.8.0.7
[DEBUG]   com.h2database:h2:jar:1.2.132
[DEBUG]   postgresql:postgresql:jar:8.4-701.jdbc4
[DEBUG]   mysql:mysql-connector-java:jar:5.1.9
[DEBUG]   org.apache.tomcat:catalina:jar:6.0.20
[DEBUG]   org.mortbay.jetty:jetty:jar:6.1.1
[DEBUG]   org.eclipse.jetty:jetty-server:jar:7.0.1.v20091125
[DEBUG]   org.mortbay.jetty:servlet-api-2.5:jar:6.1.1
[DEBUG]   org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.0
[DEBUG]   javax.servlet:servlet-api:jar:2.5
[DEBUG]   org.scala-lang:scala-library:jar:2.7.7
[DEBUG]     ch.qos.logback:logback-core:jar:0.9.28:compile (selected for compile)
[DEBUG] Retrieving parent-POM: org.slf4j:slf4j-parent:pom:1.6.1 for project: org.slf4j:slf4j-api:jar:null from the repository.
[DEBUG] Adding managed dependencies for org.slf4j:slf4j-api
[DEBUG]   org.slf4j:slf4j-api:jar:1.6.1
[DEBUG]   org.slf4j:slf4j-jdk14:jar:1.6.1
[DEBUG]   log4j:log4j:jar:1.2.16
[DEBUG]   ch.qos.cal10n:cal10n-api:jar:0.7.4
[DEBUG]     org.slf4j:slf4j-api:jar:1.6.1:compile (selected for compile)
[DEBUG]   ch.qos.logback:logback-core:jar:0.9.28:compile (selected for compile)
[DEBUG]   org.slf4j:slf4j-api:jar:1.6.1:compile (selected for compile)
[DEBUG] WARNING: A dependency of the current project (or of one the plugins used in its build) was found in the reactor, 
but had not been built at the time it was requested. It will be resolved from the repository instead.

Current Project: JORLib - Demo
Requested Dependency: org.jorlib:jorlib-core:jar:1.0-SNAPSHOT

NOTE: You may need to run this build to the 'compile' lifecycle phase, or farther, in order to build the dependency artifact.

The module jorlib-demo depends on jorlib-core, so it must first compile jorlib-core before it compiles jorlib-demo. For some reason this doesn't happen. As a result, it searches for jorlib-core in some external depository and fails eventually because it couldn't find it.

  1. My parent pom: parent pom
  2. The pom in jorlib-core: pom jorlib-core
  3. The pom in jorlib-demo: pom jorlib-demo
4

1 回答 1

1

原来这个问题是我的Maven版本引起的。我的系统运行 Java 1.8.0_45 和 Apache Maven 2.2.1 (rdebian-8)。在撰写本文时,最新的 Ubuntu LTS (14.04.2) 版本默认附​​带后一个 Maven 版本。我现在已经升级到 Apache Maven 3.2.1。升级到 Maven 3 后,我在执行 jgitflow:release-finish 时确实遇到了以下错误消息:

Error: JAVA_HOME is not defined correctly. 
We cannot execute /usr/lib/jvm/java-8-oracle/bin/java/bin/java

这有效地禁止了代码被编译。注意奇怪的bin/java/bin/java部分。我仔细检查了我的$JAVA_HOME哪个正确指向/usr/lib/jvm/java-8-oracle/。可以在此处找到此问题的解决方案: Have JAVA_HOME inconsistency issue with maven 我只是在我的主文件夹中创建了一个名为 .mavenrc 的文件,其中包含:export JAVA_HOME=/usr/lib/jvm/java-8-oracle

现在 Jgitflow 插件运行良好。

于 2015-06-15T15:22:29.033 回答