Taylor Cowan wrote:
I have maven'ized my builds on jena, putting away my long time friend
ant, and as far as jena proper, all is well, however, when I use SDB
like this:
<dependency>
<groupId>com.hp.hpl.jena</groupId>
<artifactId>sdb</artifactId>
<version>1.2.0</version>
</dependency>
Maven only brings down jena-2.5.7. I've fixed this by adding a direct
dependency reference to Jena in my pom.xml. Is that expected, or should
maven see sdb, get jena, then follow the transitive dependencies as well?
Taylor could you try to run:
mvn dependency:purge-local-repository dependency:tree
and tell me if this helps?
If not, could you try to manually clean your Maven local repository?
Remove .m2/repository/com/hp/hpl/jena/ and try again
mvn dependency:tree
Does this help?
Paolo
- o -
Long version (read only if you use SDB and Maven).
SDB v1.2.0, according to [1], depends on:
group id artifact id version scope
------------------ ---------------- ---------- ----------------------
com.hp.hpl.jena arq 2.6.0 unspecified => compile
com.hp.hpl.jena arq-extra 2.6.0 unspecified => compile
junit junit 4.4 test
------------------ ---------------- ---------- ----------------------
ARQ v1.2.0, according to [2], depends on:
group id artifact id version scope
------------------ ---------------- ---------- ----------------------
com.hp.hpl.jena jena 2.5.7 unspecified => compile
org.apache.lucene lucene-core 2.3.1 unspecified => compile
stax stax-api 1.0 unspecified => compile
woodstox wstx-asl 3.0.0 unspecified => compile
com.hp.hpl.jena json-jena 1.0 unspecified => compile
------------------ ---------------- ---------- ----------------------
ARQ Extra v2.6.0, according to [3], depends on:
group id artifact id version scope
------------------ ---------------- ---------- ----------------------
com.hp.hpl.jena arq 2.6.0 unspecified => compile
com.hp.hpl.jena jenatest 2.5.7 test
------------------ ---------------- ---------- ----------------------
Jena v2.5.7, according to [4], depends on:
group id artifact id version scope
------------------ ---------------- ---------- ----------------------
com.hp.hpl.jena arq 2.6.0 unspecified => compile
com.hp.hpl.jena jena-test (*) 2.5.7 test
com.hp.hpl.jena arq-extra 2.6.0 test
com.hp.hpl.jena iri 0.5 unspecified => compile
antlr antlr 2.7.5 unspecified => compile
commons-logging commons-logging 1.1.1 unspecified => compile
com.hp.hpl.jena concurrent-jena 1.3.2 unspecified => compile
com.ibm.icu icu4j 3.4.4 unspecified => compile
xerces xercesImpl 2.7.1 unspecified => compile
xerces xmlParserAPIs 2.0.2 unspecified => compile
------------------ ---------------- ---------- ----------------------
(*) this should be jenatest (or all the jenatest(s) should be jena-test)
Jena Tests v2.5.7, according to [5], depends on:
group id artifact id version scope
------------------ ---------------- ---------- ----------------------
com.hp.hpl.jena jena 2.5.7 unspecified => compile
junit junit 3.8.1 test
------------------ ---------------- ---------- ----------------------
So, we have a "circular dependencies" between ARQ and Jena.
Maven does not like circular dependencies at build time, but we do not use
Maven to create those artifacts. So, the circularity does not get caught at
build time.
I am not clear on what is the situation when a circular dependency is in
place and you use Maven to transitively resolve dependencies.
I've a similar issue described by Taylor using a POM file which contains
only one dependency to SDB v1.2.0:
<dependencies>
<dependency>
<groupId>com.hp.hpl.jena</groupId>
<artifactId>sdb</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
My issue was that only ARQ and ARQ Extra artifacts were retrieved, but not
Jena.
I've used Maven v2.0.6 and v2.0.9 on Linux and Windows.
mvn dependency:resolve
mvn dependency:list
mvn dependency:tree
mvn dependency:purge-local-repository
...
But, only after I manually cleaned my Maven local repository I managed to
get:
casta...@castagna:/tmp/test$ mvn dependency:tree
[INFO] [dependency:tree]
[INFO] com.hp.hpl.test:test:jar:0.1
[INFO] \- com.hp.hpl.jena:sdb:jar:1.2.0:compile
[INFO] +- com.hp.hpl.jena:arq:jar:2.6.0:compile
[INFO] | +- com.hp.hpl.jena:jena:jar:2.5.7:compile
[INFO] | +- org.apache.lucene:lucene-core:jar:2.3.1:compile
[INFO] | +- stax:stax-api:jar:1.0:compile
[INFO] | +- woodstox:wstx-asl:jar:3.0.0:compile
[INFO] | \- com.hp.hpl.jena:json-jena:jar:1.0:compile
[INFO] \- com.hp.hpl.jena:arq-extra:jar:2.6.0:compile
However, there are things that I do not understand.
Why dependency:purge-local-repository [6] did not work properly?
Where are the artifacts which Jena depends on?
com.hp.hpl.jena iri 0.5 unspecified => compile
antlr antlr 2.7.5 unspecified => compile
commons-logging commons-logging 1.1.1 unspecified => compile
com.hp.hpl.jena concurrent-jena 1.3.2 unspecified => compile
com.ibm.icu icu4j 3.4.4 unspecified => compile
xerces xercesImpl 2.7.1 unspecified => compile
xerces xmlParserAPIs 2.0.2 unspecified => compile
If Maven does not like circular dependencies, why it does not throw a
clear error message?
To conclude, I think to go around this problem, as you suggest, you can add
explicitly a dependency on Jena v2.5.7 (however, this is not transitive
dependency management anymore!):
<dependency>
<groupId>com.hp.hpl.jena</groupId>
<artifactId>sdb</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>com.hp.hpl.jena</groupId>
<artifactId>jena</artifactId>
<version>2.5.7</version>
</dependency>
Gives you:
[INFO] [dependency:tree]
[INFO] com.hp.hpl.test:test:jar:0.1
[INFO] +- com.hp.hpl.jena:sdb:jar:1.2.0:compile
[INFO] | +- com.hp.hpl.jena:arq:jar:2.6.0:compile
[INFO] | | +- org.apache.lucene:lucene-core:jar:2.3.1:compile
[INFO] | | +- stax:stax-api:jar:1.0:compile
[INFO] | | +- woodstox:wstx-asl:jar:3.0.0:compile
[INFO] | | \- com.hp.hpl.jena:json-jena:jar:1.0:compile
[INFO] | \- com.hp.hpl.jena:arq-extra:jar:2.6.0:compile
[INFO] \- com.hp.hpl.jena:jena:jar:2.5.7:compile
[INFO] +- com.hp.hpl.jena:iri:jar:0.5:compile
[INFO] +- antlr:antlr:jar:2.7.5:compile
[INFO] +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- com.hp.hpl.jena:concurrent-jena:jar:1.3.2:compile
[INFO] +- com.ibm.icu:icu4j:jar:3.4.4:compile
[INFO] +- xerces:xercesImpl:jar:2.7.1:compile
[INFO] \- xerces:xmlParserAPIs:jar:2.0.2:compile
Paolo
[1] http://repo2.maven.org/maven2/com/hp/hpl/jena/sdb/1.2.0/sdb-1.2.0.pom
[2] http://repo2.maven.org/maven2/com/hp/hpl/jena/arq/2.6.0/arq-2.6.0.pom
[3]
http://repo2.maven.org/maven2/com/hp/hpl/jena/arq-extra/2.6.0/arq-extra-2.6.0.pom
[4] http://repo2.maven.org/maven2/com/hp/hpl/jena/jena/2.5.7/jena-2.5.7.pom
[5]
http://repo2.maven.org/maven2/com/hp/hpl/jena/jenatest/2.5.7/jenatest-2.5.7.pom
[6]
http://maven.apache.org/plugins/maven-dependency-plugin/purge-local-repository-mojo.html
--
Hewlett-Packard Limited - Cain Rd., Bracknell, Berks RG12 1HN, 690597 England
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org