You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by paul geer <sd...@gmail.com> on 2010/07/12 15:29:14 UTC

maven installing artifacts to wrong repository location

Hello,

I am trying to have maven install a jar into my local repository with the
following from the command line:

mvn install:install-file -DgroupId=org.us.test -DartifactId=JSJava
-Dversion=0.0.1 -Dpackaging=jar -Dfile=JSJava-0.0.1.jar

This completes successfully, but the jar, pom and dependencies end up in
c:\.m2\repository rather than <userhome>\.m2\repository.  This line is from
maven's output:

[INFO] Installing C:\TEMP\jars\JSJava-0.0.1.jar to
\.m2\repository\org\bjc\ebiz\JSJava\0.0.1\JSJava-0.0.1.jar


Both settings.xml files (the one in <maven install>/conf and
<userhome>//m2)  have default values for the localrepository location.  I
have tried providing manual locations such as "~/.m2/repository",
"${user.home}/.m2/repository" and "c:/documents and settings/<my actual
username>/.m2/repository", but maven always uses the file system room.  To
verify that maven is actually using these settings files, I have introduced
errors to them and verified that maven does complain and abort that one of
the files is unreadable.

To test things, I wrote a class that prints the user.home system property to
console and it is correct (c:\documents and settings\<my username>).

I would appreciate some direction in what to try next.

thanks,
paul

Re: maven installing artifacts to wrong repository location

Posted by paul geer <sd...@gmail.com>.
Thanks for the quick reply.  I thought of deleting the settings files, but I
need at least one for proxy navigation.  Your  suggestion did provide a
solution, though, and for future users experiencing the problem:

I tried it both ways and it worked when I put the proxy data in the install
settings.xml and deleted the one in my user home.  When I ran the install,
it worked.  I then copied that settings file into the .m2 directory in the
userhome for m2eclipse to have the proxy settings.  So far command line and
plugin seem to be working as they should.

thanks again.

On Mon, Jul 12, 2010 at 9:58 AM, Wayne Fay <wa...@gmail.com> wrote:

> > This completes successfully, but the jar, pom and dependencies end up in
> > c:\.m2\repository rather than <userhome>\.m2\repository.  This line is
> from
>
> Rename the settings.xml files to settings.ignore and try again.
>
> Also check the value of environment variables with "set." On Windows,
> the default should be to install to homedrive + homepath + .m2 or
> maybe userprofile + .m2, unsure, but in my case those values are
> identical.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: maven installing artifacts to wrong repository location

Posted by Wayne Fay <wa...@gmail.com>.
> This completes successfully, but the jar, pom and dependencies end up in
> c:\.m2\repository rather than <userhome>\.m2\repository.  This line is from

Rename the settings.xml files to settings.ignore and try again.

Also check the value of environment variables with "set." On Windows,
the default should be to install to homedrive + homepath + .m2 or
maybe userprofile + .m2, unsure, but in my case those values are
identical.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org