telmo
telmo

Reputation: 153

Can Sonatype Nexus use maven's local repository

I now have a PC working as a Sonatype Nexus server and a development environment. I know Nexus stores artifacts for proxy type repository in SonatypRoot\sonatype-work\nexus\storage, and Maven will use a local repository to store artifacts (default directory is C:\USERS\USER_NAME\.m2\repository).

So the question comes when I'm using Maven with Nexus running on the same machine, because i have two copies of every artifact which is big waste of storage.

In Nexus's configuration tab for proxy type repository, there is an option named Override Local Storage Location.

My question is can I set this to my Maven's local repository?

Upvotes: 2

Views: 803

Answers (1)

gerrytan
gerrytan

Reputation: 41123

That's a bad idea. One common purpose of nexus to publish artifact internally within your organisation. Typically this is done using mvn deploy. On the other hand your maven local repository serves purpose as a cache to avoid downloading stuff that has been obtained before. If you mix them together you might be accidentally publishing artifacts to your organisation while you just want to test locally in your PC.

Upvotes: 3

Related Questions