
If you need to frequently change your jar library, using Maven SNAPSHOT mayīe better than using the above technique. The previous sectionĪbout installing the jar in a local repository is also a prerequisite. Install local jar dependency as part of the lifecycle, before Maven attempts to resolve it Heres the few solutions I tried, but werent great for my uses: 1. It is quite an hack, all the more since you will have to do the same pluginīlock to take into account other potential jar files.

maven-install-plugin copy-jar validate install-file lib-maven/net/alea/test/sample-lib/1.0/sample-lib.jar default sample-lib 1.0 jar You can add the following in your pom.xml if you want Maven cache to at ~/.m2/repository/net/alea/test in our case). By default, you have to manually delete in the Maven cache your While the local repository mechanism work, the problem is Maven does notĪutomatically take into account the jar if you update it using the same There is not sense in distributing a library that depends on local resources. Libraries since the local repository configuration will stay in the pom file. It should also be used for end-project, and not for distribuable jar The same jar and someone already build your project, the new jar will not be Otherwise Maven will not recognize that it was updated.

You must also change the version of the jar library in case of an update, The only thing is to correctly use the maven commands, even to update the jar. The local repository and then transparently copied in the Maven cache. When someone launches a mvn command, dependencies will also be looked into

sample-lib 1.0 system $/lib-maven/ sample-lib 1.0
