Question

I have set up nexus on a server and now I would like to ensure that my local machine only uses nexus to get any dependencies and never goes to its local .m2 directory.

Is there a recommended way to do this and in fact is this even recommended at all?

Thanks

Était-ce utile?

La solution

You always have to use your local .m2 directory, because otherwise Java would not be able to put the JARs to classpath.

If you always want to update your local repositories with the versions from e.g. Nexus, then use "mvn -U" or "mvn --update-snapshots" which "Forces a check for updated releases and snapshots on remote repositories" according to http://books.sonatype.com/mvnref-book/reference/running-sect-options.html.

Otherwise remote repositories are only checked daily if there is already an artifact within local repository.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top