You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Russ Tremain <Ru...@Sun.COM> on 2008/05/05 18:59:07 UTC

maven.repo.local, again

Is there any property set by maven that tells me where the local 
build repository is?

I.e., once it resolves where it is going to build, will it tell me?

I think the answer is just plain no, but I want to re-confirm.

tia,
-Russ

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


RE: maven.repo.local, again

Posted by Russ Tremain <Ru...@Sun.COM>.
Yes!  This property reflects ${maven.repo.local} when I pass -Dmaven.repo.local=...,
and returns ~/.m2/repository if I do not.  Exactly what I needed.

I was under the false impression that one had to define it in ~/.m2/settings.xml
in order to use it.

thanks -
-Russ

% mvn -Dmaven.repo.local=/tmp/foo validate
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[INFO] Building Unnamed - foogroup:foo:jar:1.0
[INFO]    task-segment: [validate]
[INFO] ----------------------------------------------------------------------------
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
     [echo] local repo=/tmp/foo
[INFO] Executed tasks
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed May 07 07:03:05 PDT 2008
[INFO] Final Memory: 3M/31M
[INFO] ------------------------------------------------------------------------

% mvn validate
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[INFO] Building Unnamed - foogroup:foo:jar:1.0
[INFO]    task-segment: [validate]
[INFO] ----------------------------------------------------------------------------
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
     [echo] local repo=/export/home/testuser/.m2/repository
[INFO] Executed tasks
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed May 07 07:03:15 PDT 2008
[INFO] Final Memory: 3M/31M
[INFO] ------------------------------------------------------------------------

% cat pom.xml
<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>foogroup</groupId>
    <artifactId>foo</artifactId>
    <version>1.0</version>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals><goal>run</goal></goals>
                        <configuration>
                            <tasks><echo message="local repo=${settings.localRepository}" /></tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

% mvn --version
Maven version: 2.0.5


At 3:27 PM -0400 5/6/08, Brian E. Fox wrote:
>${settings.localRepository} should work IIRC.
>
>-----Original Message-----
>From: Brewster, Richard [mailto:richardbrewster@pqa.com]
>Sent: Tuesday, May 06, 2008 9:57 AM
>To: Maven Users List
>Subject: RE: maven.repo.local, again
>
>Does Maven provide a property with the path to the local repo?  I think
>the answer is 'no'.  I define a real property in my settings.xml,
>redundantly with <localRepository>.
>
>    <localRepository>c:/m2/repository</localRepository>
>       <profile>
>            <id>my-profile</id>
>            <activation>
>                <activeByDefault>true</activeByDefault>
>            </activation>
>            <properties>
>                <local.repository>c:/m2/repository</local.repository>
>		</properties>
>...
>
><localRepository> tells Maven where the repo is, but it is NOT a
>property.  You can access it like a property with ${localRepository},
>but this does not resolve to the value you expect.
>
>Richard Brewster
>Senior Associate
>Perrin Quarles Associates
>richardbrewster@pqa.com
>(434) 817-2640
>
>
>-----Original Message-----
>From: Beelen, M. - SPLXL [mailto:Marco.Beelen@klm.com]
>Sent: Tuesday, May 06, 2008 3:42 AM
>To: Maven Users List
>Subject: RE: maven.repo.local, again
>
>-----Original Message-----
>From: Russ.Tremain@Sun.COM [mailto:Russ.Tremain@Sun.COM]
>Sent: Monday, May 05, 2008 6:59 PM
>To: users@maven.apache.org
>Subject: maven.repo.local, again
>
>Is there any property set by maven that tells me where the local build
>repository is?
>
>I.e., once it resolves where it is going to build, will it tell me?
>
>I think the answer is just plain no, but I want to re-confirm.
>
>tia,
>-Russ
>---------------------------------------------------------------------
>
>Hello Russ,
>
>You local repository is in %USER_HOME%\.m2\repository unless your
>specified otherwise in your settings.xml (located in %USER_HOME%\.m2) or
>your maven config (settings.xml in %MAVEN_HOME%\conf)
>
>When I run mvn install near the end the output shows:
>
>[INFO] [jar:jar]
>[INFO] Building jar:
>%PROJECT_HOME%\target\${artifactId}-${pom-version}.jar
>[INFO] [install:install]
>[INFO] Installing %PROJECT_HOME%\target\${artifactId}-${pom-version}.jar
>to
>%LOCAL_M2_REPO%\${groupId}\${artifactId}\${pom-version}\${artifactId}-${
>pom-version}.jar
>[INFO]
>------------------------------------------------------------------------
>[INFO] BUILD SUCCESSFUL
>
>
>It doesn't set any environment settings, which is a good thing IMHO.
>
>With regards,
>  Marco
>**********************************************************************
>For information, services and offers, please visit our web site:
>http://www.klm.com. This e-mail and any attachment may contain
>confidential and privileged material intended for the addressee only. If
>you are not the addressee, you are notified that no part of the e-mail
>or any attachment may be disclosed, copied or distributed, and that any
>other action related to this e-mail or attachment is strictly
>prohibited, and may be unlawful. If you have received this e-mail by
>error, please notify the sender immediately by return e-mail, and delete
>this message.
>
>Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or
>its employees shall not be liable for the incorrect or incomplete
>transmission of this e-mail or any attachments, nor responsible for any
>delay in receipt.
>Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch
>Airlines) is registered in Amstelveen, The Netherlands, with registered
>number 33014286
>**********************************************************************
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org


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


RE: maven.repo.local, again

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
${settings.localRepository} should work IIRC.

-----Original Message-----
From: Brewster, Richard [mailto:richardbrewster@pqa.com] 
Sent: Tuesday, May 06, 2008 9:57 AM
To: Maven Users List
Subject: RE: maven.repo.local, again

Does Maven provide a property with the path to the local repo?  I think
the answer is 'no'.  I define a real property in my settings.xml,
redundantly with <localRepository>.

    <localRepository>c:/m2/repository</localRepository>
       <profile>
            <id>my-profile</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <local.repository>c:/m2/repository</local.repository>
		</properties>
...

<localRepository> tells Maven where the repo is, but it is NOT a
property.  You can access it like a property with ${localRepository},
but this does not resolve to the value you expect.

Richard Brewster
Senior Associate
Perrin Quarles Associates
richardbrewster@pqa.com
(434) 817-2640


-----Original Message-----
From: Beelen, M. - SPLXL [mailto:Marco.Beelen@klm.com] 
Sent: Tuesday, May 06, 2008 3:42 AM
To: Maven Users List
Subject: RE: maven.repo.local, again

-----Original Message-----
From: Russ.Tremain@Sun.COM [mailto:Russ.Tremain@Sun.COM]
Sent: Monday, May 05, 2008 6:59 PM
To: users@maven.apache.org
Subject: maven.repo.local, again

Is there any property set by maven that tells me where the local build
repository is?

I.e., once it resolves where it is going to build, will it tell me?

I think the answer is just plain no, but I want to re-confirm.

tia,
-Russ
---------------------------------------------------------------------

Hello Russ,

You local repository is in %USER_HOME%\.m2\repository unless your
specified otherwise in your settings.xml (located in %USER_HOME%\.m2) or
your maven config (settings.xml in %MAVEN_HOME%\conf)

When I run mvn install near the end the output shows:

[INFO] [jar:jar]
[INFO] Building jar:
%PROJECT_HOME%\target\${artifactId}-${pom-version}.jar
[INFO] [install:install]
[INFO] Installing %PROJECT_HOME%\target\${artifactId}-${pom-version}.jar
to
%LOCAL_M2_REPO%\${groupId}\${artifactId}\${pom-version}\${artifactId}-${
pom-version}.jar
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL


It doesn't set any environment settings, which is a good thing IMHO.

With regards,
  Marco
**********************************************************************
For information, services and offers, please visit our web site:
http://www.klm.com. This e-mail and any attachment may contain
confidential and privileged material intended for the addressee only. If
you are not the addressee, you are notified that no part of the e-mail
or any attachment may be disclosed, copied or distributed, and that any
other action related to this e-mail or attachment is strictly
prohibited, and may be unlawful. If you have received this e-mail by
error, please notify the sender immediately by return e-mail, and delete
this message. 

Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or
its employees shall not be liable for the incorrect or incomplete
transmission of this e-mail or any attachments, nor responsible for any
delay in receipt.
Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch
Airlines) is registered in Amstelveen, The Netherlands, with registered
number 33014286
**********************************************************************

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


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


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


RE: maven.repo.local, again

Posted by "Brewster, Richard" <ri...@pqa.com>.
Does Maven provide a property with the path to the local repo?  I think
the answer is 'no'.  I define a real property in my settings.xml,
redundantly with <localRepository>.

    <localRepository>c:/m2/repository</localRepository>
       <profile>
            <id>my-profile</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <local.repository>c:/m2/repository</local.repository>
		</properties>
...

<localRepository> tells Maven where the repo is, but it is NOT a
property.  You can access it like a property with ${localRepository},
but this does not resolve to the value you expect.

Richard Brewster
Senior Associate
Perrin Quarles Associates
richardbrewster@pqa.com
(434) 817-2640


-----Original Message-----
From: Beelen, M. - SPLXL [mailto:Marco.Beelen@klm.com] 
Sent: Tuesday, May 06, 2008 3:42 AM
To: Maven Users List
Subject: RE: maven.repo.local, again

-----Original Message-----
From: Russ.Tremain@Sun.COM [mailto:Russ.Tremain@Sun.COM]
Sent: Monday, May 05, 2008 6:59 PM
To: users@maven.apache.org
Subject: maven.repo.local, again

Is there any property set by maven that tells me where the local build
repository is?

I.e., once it resolves where it is going to build, will it tell me?

I think the answer is just plain no, but I want to re-confirm.

tia,
-Russ
---------------------------------------------------------------------

Hello Russ,

You local repository is in %USER_HOME%\.m2\repository unless your
specified otherwise in your settings.xml (located in %USER_HOME%\.m2) or
your maven config (settings.xml in %MAVEN_HOME%\conf)

When I run mvn install near the end the output shows:

[INFO] [jar:jar]
[INFO] Building jar:
%PROJECT_HOME%\target\${artifactId}-${pom-version}.jar
[INFO] [install:install]
[INFO] Installing %PROJECT_HOME%\target\${artifactId}-${pom-version}.jar
to
%LOCAL_M2_REPO%\${groupId}\${artifactId}\${pom-version}\${artifactId}-${
pom-version}.jar
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL


It doesn't set any environment settings, which is a good thing IMHO.

With regards,
  Marco
**********************************************************************
For information, services and offers, please visit our web site:
http://www.klm.com. This e-mail and any attachment may contain
confidential and privileged material intended for the addressee only. If
you are not the addressee, you are notified that no part of the e-mail
or any attachment may be disclosed, copied or distributed, and that any
other action related to this e-mail or attachment is strictly
prohibited, and may be unlawful. If you have received this e-mail by
error, please notify the sender immediately by return e-mail, and delete
this message. 

Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or
its employees shall not be liable for the incorrect or incomplete
transmission of this e-mail or any attachments, nor responsible for any
delay in receipt.
Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch
Airlines) is registered in Amstelveen, The Netherlands, with registered
number 33014286
**********************************************************************

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


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


RE: maven.repo.local, again

Posted by "Beelen, M. - SPLXL" <Ma...@klm.com>.
-----Original Message-----
From: Russ.Tremain@Sun.COM [mailto:Russ.Tremain@Sun.COM] 
Sent: Monday, May 05, 2008 6:59 PM
To: users@maven.apache.org
Subject: maven.repo.local, again

Is there any property set by maven that tells me where the local build
repository is?

I.e., once it resolves where it is going to build, will it tell me?

I think the answer is just plain no, but I want to re-confirm.

tia,
-Russ
---------------------------------------------------------------------

Hello Russ,

You local repository is in %USER_HOME%\.m2\repository unless your
specified otherwise in your settings.xml (located in %USER_HOME%\.m2) or
your maven config (settings.xml in %MAVEN_HOME%\conf)

When I run mvn install near the end the output shows:

[INFO] [jar:jar]
[INFO] Building jar:
%PROJECT_HOME%\target\${artifactId}-${pom-version}.jar
[INFO] [install:install]
[INFO] Installing %PROJECT_HOME%\target\${artifactId}-${pom-version}.jar
to
%LOCAL_M2_REPO%\${groupId}\${artifactId}\${pom-version}\${artifactId}-${
pom-version}.jar
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL


It doesn't set any environment settings, which is a good thing IMHO.

With regards,
  Marco
**********************************************************************
For information, services and offers, please visit our web site:
http://www.klm.com. This e-mail and any attachment may contain
confidential and privileged material intended for the addressee
only. If you are not the addressee, you are notified that no part
of the e-mail or any attachment may be disclosed, copied or
distributed, and that any other action related to this e-mail or
attachment is strictly prohibited, and may be unlawful. If you have
received this e-mail by error, please notify the sender immediately
by return e-mail, and delete this message. 

Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries
and/or its employees shall not be liable for the incorrect or
incomplete transmission of this e-mail or any attachments, nor
responsible for any delay in receipt.
Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal
Dutch Airlines) is registered in Amstelveen, The Netherlands, with
registered number 33014286 
**********************************************************************

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