Is there any way to tell maven where to place artifacts?

I run both maven inside the m2eclipse plugin, the windows command line and my cygwin command line.

cygwin bash shell dumps artifacts to the cygwin / home / me / .m2 directory

but m2eclipse and the windows shell (on vista) use /Users/me/Documents/.m2

Is it possible to tell the mvn command to use a single central .m2 directory?

thanks

+5
source share
3 answers

For Cygwin, create the ~ / .mavenrc file and place the following text inside:

MAVEN_OPTS="-Dmaven.repo.local=c:\documents and settings\user\.m2\repository"
export MAVEN_OPTS

Alternatively, you can create a file under /etc/.mavenrc

Another option is to create an NTFS connection between .m2 under your windows and your cygwin profile.

+4

, . settings.xml:

<settings xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository>/my/secret/repository</localRepository>
</settings>
+17

Just specify it in the settings. There is no need for cygwin heroin.

-1
source

All Articles