Zombse

The Zombie Stack Exchanges That Just Won't Die

View the Project on GitHub anjackson/zombse

How do I get JHOVE2 to build?

I've downloaded JHOVE2 and attempted to build it, using Maven through Eclipse with the target "compile". I get the following error:

[ERROR] Failed to execute goal on project jhove2: Could not resolve dependencies for project org.jhove2:jhove2:jar:2.0.0: Failed to collect dependencies for [commons-logging:commons-logging-api:jar:1.1 (compile), commons-logging:commons-logging:jar:1.1.1 (compile), org.springframework:spring-context:jar:2.5.6 (compile), org.springframework:spring-test:jar:2.5.6 (test), log4j:log4j:jar:1.2.14 (compile), junit:junit:jar:4.4 (test), jdom:jdom:jar:1.0 (compile), soap:soap:jar:2.3.1 (compile), xerces:xercesImpl:jar:2.9.1 (compile), xml-resolver:xml-resolver:jar:1.2 (compile), net.sf:jargs:jar:1.0 (compile), org.mvel:mvel2:jar:2.0.18 (compile), org.geotools:gt-main:jar:2.6.5 (compile), org.geotools:gt-shapefile:jar:2.6.5 (compile), com.sleepycat:je:jar:4.0.103 (compile)]: Failed to read artifact descriptor for net.sf:jargs:jar:1.0: Could not transfer artifact net.sf:jargs:pom:1.0 from/to JBOSS (http://repository.jboss.org/maven2/): Access denied to http://repository.jboss.org/maven2/net/sf/jargs/1.0/jargs-1.0.pom. Error code 403, Forbidden -> [Help 1]

This may be because JHOVE2 hasn't been updated in a few years, so the dependencies in its pom.xml perhaps are no longer valid. On the other hand, every time I touch Maven something bad happens, so I may just be doing something dumb. Are there any changes to pom.xml or other tricks which can get the build working?

gmcgath

Comments

Answer by ksclarke

You're right... the repository that was used at the time that the JHOVE2 pom.xml was created has been changed (so it can't resolve its dependency on jargs). You can fix this problem by making a simple change to the pom.xml file which is in the root directory of the JHOVE2 project that you downloaded.

If you open the pom.xml file with a text editor look for the following section:

<repositories>
        <!-- for jargs GNU Command Line Parser -->
        <repository>
                <id>JBOSS</id>
                <name>JBoss Repository</name>

You'll see there is a \<url> element right after the \<name> element listed above. Change that to:

<url>https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/</url>

then save the file. The next step would be to run Maven to install it (usually done at the command line with: mvn install (but you can do it from within Eclipse too)). However when I do that with a fresh download of JHOVE2 it fails with errors in the tests that are a part of the build. If I instead build it with:

mvn -DskipTests=true install

It will build JHOVE2 while skipping the tests. I didn't look into why the tests are failing (and they might not for you -- I just grabbed the latest download from JHOVE2's BitBucket page). Hope this helps!

Comments