Reputation: 1779
I need to depend on a jar which isn't in any maven repo. I currently just have a system dependency like this:
<dependency>
<groupId>com.nexua</groupId>
<artifactId>register</artifactId>
<version>1.5</version>
<scope>system</scope>
<systemPath>${basedir}/lib/register.jar</systemPath>
</dependency>
is there some way I can have the file link to a url instead of a local file so it will stay up to date?As it stands I'll have to replace the file manually when I want it updated.
Upvotes: 2
Views: 3257
Reputation: 28697
You are best off using the internal (local) repository. This is described in more detail at «Introduction to Repositories». Basically, you just copy your artifact into the proper directory with the proper filename (following Maven conventions) underneath this internal repository, and Maven will pick it up without needing to use <systemPath>
.
This will require you to replace the file manually when it gets updated. (Actually, to do it properly, it will require you to include the new version with a separate version suffix in the internal repository, and to update the <version/>
in your pom.xml
.) The only better way around this is to have someone else manage the dependency - either in the Maven central repository, or another repository location that you reference from your pom.xml
. (In fact, you can setup your own - either for yourself or your workgroup, which I'd recommend.)
Upvotes: 1