3

I am using Netbeans to build a Maven project, and have the JTidy java library as a dependency. It turns out JTidy doesnt exist in any maven repos, so I can't just add a "normal" depedency entry for it.

What is the best way of handling dependencies to libraries in Maven projects that arent available on repos?

I've currently tried adding it to my maven pom as such (after copying the jar to my projects /libs folder)

    <dependency>
        <groupId>org.w3c</groupId>
        <artifactId>org.w3c.tidy</artifactId>
        <version>9.3.8</version>
        <scope>system</scope>
        <systemPath>${basedir}/libs/jtidy-r938.jar</systemPath>
    </dependency> 

However it complains that it will be unresolvable by dependent projects.

empire29
  • 3,729
  • 6
  • 45
  • 71

1 Answers1

3

First of all, it's under another groupId, that's why you didn't find it.

  <dependency>
        <groupId>net.sf.jtidy</groupId>
        <artifactId>jtidy</artifactId>
        <version>r938</version>
    </dependency>

Jtidy

But to answer your question, one way of doing this is to manually install it in your local repo as described here.

The best way IMHO is to add it to a proxy like Nexus. That way other people can access it from there without having to install it locally. However, this means you have to set up a repository manager, which doesn't make much sense if you are the only developer on the project.

Community
  • 1
  • 1
ebaxt
  • 8,287
  • 1
  • 34
  • 36
  • Yup - I saw the diff groupId this shortly after I posted. Thanks for the link though as this is still something i'd like to understand. – empire29 Feb 28 '12 at 01:11