Maven dependency that is online and not in repository
I'm working on a project and I need slick-util, which doesn't have really good support or anything atm. The problem is that I am using a maven system and there is no maven repository. I was wondering if I should use something like:
<groupId>slick</groupId> <artifactId>slick-util</artifactId> <version>1.0</version> <systemPath>http://whatever.com/slick/slick-util.jar</systempath> <scope>system</scope>
I tried doing something like that, but IntelliJ Idea(my ide) says it cannot find the directory. Is there something I am doing wrong, or if this won't work, is there another method of accomplishing what I want?
A system dependency will not read from a URL.
Your reasonable choices are:
- obtain and install a repo manager, such as Nexus or Artifactory.
- mvn install:install-file to put it into your local repo.
You have a few options.
1) Do a plain mvn install so Maven can find slick-util in your local .m2 repository.
2) Publish the jar to a local Nexus or Artifactory repository, and identify the repository url within the repositories section of the pom.
3) Do an mvn installl:install-file so Maven can find the jar in another folder:
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<myGroup> -DartifactId=<myArtifactId> -Dversion=<myVersion> -Dpackaging=<myPackaging> -DlocalRepositoryPath=<path-to-repo>
Here is information on the Maven install plugin.
1) Download slick-util.jar into your PC
2) Install it to your local repository giving it some group name and version, for example:
mvn install:install-file -Dfile=/path/to/slick-util.jar -DgroupId=slick-util -DartifactId=slick-util -Dversion=1.0 -Dpackaging=jar
3) Add the dependency to your pom
<dependency> <groupId>slick-util</groupId> <artifactId>slick-util</artifactId> <version>1.0</version> </dependency>
Slick Util is in Maven but in separate repository - Clojars not Central. See here.
What you need is to add this into your pom.xml:
<repositories> <repository> <id>clojars</id> <url>http://clojars.org/repo/</url> </repository> </repositories> <dependencies> <dependency> <groupId>slick-util</groupId> <artifactId>slick-util</artifactId> <version>1.0.0</version> </dependency> </dependencies>