You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Freeman, Brian" <Br...@LibertyMutual.com> on 2011/05/20 23:02:21 UTC

Looking for a pom property that stores the deploy URL

Hi,

Sorry to bother everyone, but I've looked online and have been looking at the Maven source code for a while and still haven't figured this out.  Any help you could give is greatly appreciated!

Here is my issue: I am currently using Maven with Nexus to save our build artifacts.  After we create the artifact and it has been deployed out to Nexus I would like to run an Ant script that we use to publish the URL as part of a build result.

The output from running maven prints the URL several times, for example:

[INFO] --- maven-deploy-plugin:2.5:deploy (default-deploy) @ PmInetAutoQuoteClient ---
Uploading: http://nexus.mydomain.com/content/repositories/releases/com/mydomain/test/TestProject/1.0.0/TestProject-1.0.0.zip
Uploaded: http://nexus.mydomain.com/content/repositories/releases/com/mydomain/test/TestProject/1.0.0/TestProject-1.0.0.zip (1717 KB at 2058.3 KB/sec)

Here is the ant call I'm running, I basically want to replace ${nexusUrl} with something like ${project.deploy.url}

<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<execution>
                <!-- Adds a link to the deployed zip directory out on Nexus -->
                <id>rtcLinkPublisher</id>
                <phase>deploy</phase>
                <configuration>
                        <tasks>
                                <taskdef name="linkPublisher"
                                        classname="com.ibm.team.build.ant.task.LinkPublisherTask">
                                        <classpath>
                                                <fileset dir="/opt/IBM/jazz/buildsystem/buildtoolkit">
                                                        <include name="*.jar" />
                                                </fileset>
                                        </classpath>
                                </taskdef>
                                <echo>nexusUrl: ${nexusUrl}</echo>
                                <!--
                                        uname/pwd need to be set in your settings.xml
                                        repositoryAddress and buildResultUUID are passed in by the
                                        buildEngine
                                -->
                                <linkPublisher repositoryAddress="${repositoryAddress}"
                                        userId="${rtc.username}" passwordFile="${rtc.passwordFile}"
                                        buildResultUUID="${buildResultUUID}" url="${nexusUrl}" label="${nexusUrl}"
                                        failOnError="false" />
                        </tasks>
                </configuration>
                <goals>
                        <goal>run</goal>
                </goals>
</execution>


Does anyone have any ideas or know of a way for me to access this URL via the POM so I can add it to the ant call?

Thanks,
Brian


Re: How to define local repository path in settings.xml or pom.xml?

Posted by Srinath C <sr...@gmail.com>.
Hi,
   I had exactly the same requirement while working on the build
Infrastructure in my work place.
   The last time I fished for an answer, I came across an enhancement
request that spoke of a "workspace" concept.
   Not sure about its status as of now. But glad to know that others
are facing the same needs.

Regards,
Srinath

On Saturday, May 21, 2011, Russ Tremain <ru...@releasetools.org> wrote:
> AFAIK there is no way to do this in settings.xml.  It is a chicken & egg problem that has never been effectively solved in maven.
>
> What you can do, is pass the repository location in as a property.
>
> Typically I create an alias (or a .bat file on windows):
>
>         alias svmn mvn -Dmaven.repo.local=$JV_MAVEN_REPO_LOCAL
>
> where JV_MAVEN_REPO_LOCAL is the location of your maven repo as understood by the JVM, and is set on a per-project basis.
>
> those who say that it is not important to isolate your maven build repository, typically do not care about rigorous release methodologies.  The artifacts cached in your build repository are part of each release build, and should be preserved as part of the release artifacts.  People play all kinds of games with external artifacts - it is important to immunize your release process from this.
>
> /r
>
>
>
> At 2:26 PM -0700 5/20/11, Petr V. wrote:
>>I am trying to define local repository path in settings.xml on Windows.
>>
>>I have a windows environment variable CODE_BASE=C:\mycode
>>
>>In settings.xml , I put
>>
>><localRepository>${env.CODE_BASE}\build\local_depot</localRepository>
>>
>>But it does not read environment variable. How can I read environment variable in settings.xml.
>>
>>If that's not a possibility, can I define local repository in pom.xml of project?
>>
>>Your help will be much appreciated.
>>
>>Thanks,
>
>
> ---------------------------------------------------------------------
> 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: How to define local repository path in settings.xml or pom.xml?

Posted by Russ Tremain <ru...@releasetools.org>.
AFAIK there is no way to do this in settings.xml.  It is a chicken & egg problem that has never been effectively solved in maven.

What you can do, is pass the repository location in as a property.

Typically I create an alias (or a .bat file on windows):

	alias svmn mvn -Dmaven.repo.local=$JV_MAVEN_REPO_LOCAL

where JV_MAVEN_REPO_LOCAL is the location of your maven repo as understood by the JVM, and is set on a per-project basis.

those who say that it is not important to isolate your maven build repository, typically do not care about rigorous release methodologies.  The artifacts cached in your build repository are part of each release build, and should be preserved as part of the release artifacts.  People play all kinds of games with external artifacts - it is important to immunize your release process from this.

/r



At 2:26 PM -0700 5/20/11, Petr V. wrote:
>I am trying to define local repository path in settings.xml on Windows.
>
>I have a windows environment variable CODE_BASE=C:\mycode
>
>In settings.xml , I put
>
><localRepository>${env.CODE_BASE}\build\local_depot</localRepository>
>
>But it does not read environment variable. How can I read environment variable in settings.xml.
>
>If that's not a possibility, can I define local repository in pom.xml of project?
>
>Your help will be much appreciated.
>
>Thanks,


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


Re: How to define local repository path in settings.xml or pom.xml?

Posted by Ron Wheeler <rw...@artifact-software.com>.
On 22/05/2011 1:19 PM, Justin Lee wrote:
> Isn't that what the dependency and/or the assembly plugins are for?
I think that you are right and that is why I have been asking for more 
details about the general environment and what he is trying to build.

I think that he got off on the wrong foot and is trying to solve a 
technical problem that he invented by missing the part about how to 
build an application that can run.

Ron

> On Sun, May 22, 2011 at 1:13 PM, Petr V.<gr...@yahoo.com>  wrote:
>
>> Thanks Ron and Brian for your replies.
>>
>> We have our internal maven repository (mirrored) and we have very rigorous
>> release process.
>>
>> If all our dependencies are in one central location for all our existing
>> projects then how do we decide what jar files are actually needed to be
>> shipped for one particular product?
>>
>> We have very simple requirement i-e. all that needs to be shipped should be
>> in build output directory. Just give some one "build" output directory and
>> he has every thing that needs to be shipped, deployed and run. Nothing less,
>> nothing extra.
>>
>> I hope I have cleared my requirements.
>>
>> Right now, we are asking developers to pass -Dmaven.local.repo as part of
>> their maven command but we want developers not to worry about that.
>>
>> Thanks,
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> --- On Sun, 5/22/11, Brian Topping<to...@codehaus.org>  wrote:
>>
>> From: Brian Topping<to...@codehaus.org>
>> Subject: Re: How to define local repository path in settings.xml or
>> pom.xml?
>> To: "Maven Users List"<us...@maven.apache.org>
>> Date: Sunday, May 22, 2011, 11:54 AM
>>
>> On May 21, 2011, at 10:41 PM, Ron Wheeler wrote:
>>
>>> On 20/05/2011 9:06 PM, Petr V. wrote:
>>>> Thanks Brian for your reply.
>>>>
>>>> Our developers work on several projects at same time using same machine.
>> What we want is that when they build the particular project then every thing
>> related to project goes to its own build directory (lot of output other than
>> jars) instead of putting every thing in central m2 location.
>>> I think that Brian is asking "Why do you want to do this?"
>> Yes, that approximates what I was asking pretty well.  :-)
>>
>> Petr, the only time I've ever had a mind to intentionally manipulate my
>> repository is when I want to make sure that a new build that I am committing
>> does not have any missing dependencies.  In other words, a build might work
>> on my machine, but not on another machine because of a missing dependency.
>>
>> The path to that happening is (for instance) if I have built a version of
>> an artifact from source with 'mvn install', but that version does not exist
>> in a remote repository that the build is configured to look in.  If someone
>> else were to try this new build without a copy of my local repository, their
>> build will fail.
>>
>> Note that this is the correct behavior!
>>
>> So by moving my repository aside and doing a build ("mv ~/.m2/respository
>> /tmp; mvn clean install"), I am forcing my machine to grab every dependency
>> (direct or transitive) and fail if one of those dependencies does not exist
>> in a configured remote repository.  When it succeeds, I usually move my old
>> repository back ("rm -rf ~.m2/repository; mv /tmp/repository ~/.m2") because
>> the old one has a lot of dependencies from other projects that I work on but
>> don't want to download again.
>>
>> Also note that I am not saying "public repository" instead of "remote
>> repository".  Some of the aforementioned dependencies that will be missing
>> by some people may be dependencies that they do not have source for, but are
>> not public dependencies either.  Hypothetically, if my company has super
>> sekrit algorithms that we don't want the source floating around for, we
>> might only provide binaries to most developers.  These binaries come from a
>> *private remote repository* such as Nexus (but could just be a writable
>> WebDAV directory) that lives *inside the firewall*.  There are tens or
>> hundreds of thousands of these private repositories in use around the world.
>>
>> If I were to guess where you and Srinath might be having problems, it's
>> because you aren't running a private repository for your company's artifacts
>> like this.  When I do a 'mvn install', my build only goes to my local
>> repository, which limits any brain-damaged code to my local machine.  I do
>> this over and over until it's ready to share, and when it's ready, I do a
>> 'mvn deploy' to share it.  For smaller companies with no QA resources,
>> everyone might have the credentials to deploy to a private repository, but
>> they don't do so until they have really done their homework and are sure the
>> artifacts are ready for their teammates to use.
>>
>> The other thing that might be happening is you aren't using the release
>> plugin.  Teams of people need to make releases when milestones are
>> released.  For a small company, a great milestone is "I want to push this
>> software out to customers".  I never let snapshot builds reach a customer.
>> Never never never!  But if all a team creates is 1.0-SNAPSHOT versions,
>> there's never any way to find those milestones over time.  This would be a
>> reason to have multiple copies of a repository, but completely unnecessary
>> if a single repository is properly creating distinct releases in a single
>> repository.
>>
>> Versions are so important that I bake the version string into every build,
>> for instance into an admin screen.  Bugs get filed against that version
>> string, and if there's no version in a bug, we assume it cannot be
>> reproduced without wasting time checking every version, so we reject it.
>>
>> I apologize for all the text, but maybe this helps you and Srinath see some
>> things you aren't doing.  Please continue to ask questions until you get
>> your questions resolved!  If we can help you, you'll eventually help
>> others!
>>
>> Cheers, Brian
>> ---------------------------------------------------------------------
>> 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: How to define local repository path in settings.xml or pom.xml?

Posted by Justin Lee <ev...@gmail.com>.
Isn't that what the dependency and/or the assembly plugins are for?

On Sun, May 22, 2011 at 1:13 PM, Petr V. <gr...@yahoo.com> wrote:

> Thanks Ron and Brian for your replies.
>
> We have our internal maven repository (mirrored) and we have very rigorous
> release process.
>
> If all our dependencies are in one central location for all our existing
> projects then how do we decide what jar files are actually needed to be
> shipped for one particular product?
>
> We have very simple requirement i-e. all that needs to be shipped should be
> in build output directory. Just give some one "build" output directory and
> he has every thing that needs to be shipped, deployed and run. Nothing less,
> nothing extra.
>
> I hope I have cleared my requirements.
>
> Right now, we are asking developers to pass -Dmaven.local.repo as part of
> their maven command but we want developers not to worry about that.
>
> Thanks,
>
>
>
>
>
>
>
>
>
> --- On Sun, 5/22/11, Brian Topping <to...@codehaus.org> wrote:
>
> From: Brian Topping <to...@codehaus.org>
> Subject: Re: How to define local repository path in settings.xml or
> pom.xml?
> To: "Maven Users List" <us...@maven.apache.org>
> Date: Sunday, May 22, 2011, 11:54 AM
>
> On May 21, 2011, at 10:41 PM, Ron Wheeler wrote:
>
> > On 20/05/2011 9:06 PM, Petr V. wrote:
> >> Thanks Brian for your reply.
> >>
> >> Our developers work on several projects at same time using same machine.
> What we want is that when they build the particular project then every thing
> related to project goes to its own build directory (lot of output other than
> jars) instead of putting every thing in central m2 location.
> > I think that Brian is asking "Why do you want to do this?"
>
> Yes, that approximates what I was asking pretty well.  :-)
>
> Petr, the only time I've ever had a mind to intentionally manipulate my
> repository is when I want to make sure that a new build that I am committing
> does not have any missing dependencies.  In other words, a build might work
> on my machine, but not on another machine because of a missing dependency.
>
> The path to that happening is (for instance) if I have built a version of
> an artifact from source with 'mvn install', but that version does not exist
> in a remote repository that the build is configured to look in.  If someone
> else were to try this new build without a copy of my local repository, their
> build will fail.
>
> Note that this is the correct behavior!
>
> So by moving my repository aside and doing a build ("mv ~/.m2/respository
> /tmp; mvn clean install"), I am forcing my machine to grab every dependency
> (direct or transitive) and fail if one of those dependencies does not exist
> in a configured remote repository.  When it succeeds, I usually move my old
> repository back ("rm -rf ~.m2/repository; mv /tmp/repository ~/.m2") because
> the old one has a lot of dependencies from other projects that I work on but
> don't want to download again.
>
> Also note that I am not saying "public repository" instead of "remote
> repository".  Some of the aforementioned dependencies that will be missing
> by some people may be dependencies that they do not have source for, but are
> not public dependencies either.  Hypothetically, if my company has super
> sekrit algorithms that we don't want the source floating around for, we
> might only provide binaries to most developers.  These binaries come from a
> *private remote repository* such as Nexus (but could just be a writable
> WebDAV directory) that lives *inside the firewall*.  There are tens or
> hundreds of thousands of these private repositories in use around the world.
>
> If I were to guess where you and Srinath might be having problems, it's
> because you aren't running a private repository for your company's artifacts
> like this.  When I do a 'mvn install', my build only goes to my local
> repository, which limits any brain-damaged code to my local machine.  I do
> this over and over until it's ready to share, and when it's ready, I do a
> 'mvn deploy' to share it.  For smaller companies with no QA resources,
> everyone might have the credentials to deploy to a private repository, but
> they don't do so until they have really done their homework and are sure the
> artifacts are ready for their teammates to use.
>
> The other thing that might be happening is you aren't using the release
> plugin.  Teams of people need to make releases when milestones are
> released.  For a small company, a great milestone is "I want to push this
> software out to customers".  I never let snapshot builds reach a customer.
> Never never never!  But if all a team creates is 1.0-SNAPSHOT versions,
> there's never any way to find those milestones over time.  This would be a
> reason to have multiple copies of a repository, but completely unnecessary
> if a single repository is properly creating distinct releases in a single
> repository.
>
> Versions are so important that I bake the version string into every build,
> for instance into an admin screen.  Bugs get filed against that version
> string, and if there's no version in a bug, we assume it cannot be
> reproduced without wasting time checking every version, so we reject it.
>
> I apologize for all the text, but maybe this helps you and Srinath see some
> things you aren't doing.  Please continue to ask questions until you get
> your questions resolved!  If we can help you, you'll eventually help
> others!
>
> Cheers, Brian
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: How to define local repository path in settings.xml or pom.xml?

Posted by "Petr V." <gr...@yahoo.com>.
Thanks Ron and Brian for your replies.

We have our internal maven repository (mirrored) and we have very rigorous release process.

If all our dependencies are in one central location for all our existing projects then how do we decide what jar files are actually needed to be shipped for one particular product?

We have very simple requirement i-e. all that needs to be shipped should be in build output directory. Just give some one "build" output directory and he has every thing that needs to be shipped, deployed and run. Nothing less, nothing extra. 

I hope I have cleared my requirements. 

Right now, we are asking developers to pass -Dmaven.local.repo as part of their maven command but we want developers not to worry about that.

Thanks,









--- On Sun, 5/22/11, Brian Topping <to...@codehaus.org> wrote:

From: Brian Topping <to...@codehaus.org>
Subject: Re: How to define local repository path in settings.xml or pom.xml?
To: "Maven Users List" <us...@maven.apache.org>
Date: Sunday, May 22, 2011, 11:54 AM

On May 21, 2011, at 10:41 PM, Ron Wheeler wrote:

> On 20/05/2011 9:06 PM, Petr V. wrote:
>> Thanks Brian for your reply.
>> 
>> Our developers work on several projects at same time using same machine. What we want is that when they build the particular project then every thing related to project goes to its own build directory (lot of output other than jars) instead of putting every thing in central m2 location.
> I think that Brian is asking "Why do you want to do this?"

Yes, that approximates what I was asking pretty well.  :-)

Petr, the only time I've ever had a mind to intentionally manipulate my repository is when I want to make sure that a new build that I am committing does not have any missing dependencies.  In other words, a build might work on my machine, but not on another machine because of a missing dependency.

The path to that happening is (for instance) if I have built a version of an artifact from source with 'mvn install', but that version does not exist in a remote repository that the build is configured to look in.  If someone else were to try this new build without a copy of my local repository, their build will fail.  

Note that this is the correct behavior!  

So by moving my repository aside and doing a build ("mv ~/.m2/respository /tmp; mvn clean install"), I am forcing my machine to grab every dependency (direct or transitive) and fail if one of those dependencies does not exist in a configured remote repository.  When it succeeds, I usually move my old repository back ("rm -rf ~.m2/repository; mv /tmp/repository ~/.m2") because the old one has a lot of dependencies from other projects that I work on but don't want to download again.

Also note that I am not saying "public repository" instead of "remote repository".  Some of the aforementioned dependencies that will be missing by some people may be dependencies that they do not have source for, but are not public dependencies either.  Hypothetically, if my company has super sekrit algorithms that we don't want the source floating around for, we might only provide binaries to most developers.  These binaries come from a *private remote repository* such as Nexus (but could just be a writable WebDAV directory) that lives *inside the firewall*.  There are tens or hundreds of thousands of these private repositories in use around the world.

If I were to guess where you and Srinath might be having problems, it's because you aren't running a private repository for your company's artifacts like this.  When I do a 'mvn install', my build only goes to my local repository, which limits any brain-damaged code to my local machine.  I do this over and over until it's ready to share, and when it's ready, I do a 'mvn deploy' to share it.  For smaller companies with no QA resources, everyone might have the credentials to deploy to a private repository, but they don't do so until they have really done their homework and are sure the artifacts are ready for their teammates to use.  

The other thing that might be happening is you aren't using the release plugin.  Teams of people need to make releases when milestones are released.  For a small company, a great milestone is "I want to push this software out to customers".  I never let snapshot builds reach a customer.  Never never never!  But if all a team creates is 1.0-SNAPSHOT versions, there's never any way to find those milestones over time.  This would be a reason to have multiple copies of a repository, but completely unnecessary if a single repository is properly creating distinct releases in a single repository.

Versions are so important that I bake the version string into every build, for instance into an admin screen.  Bugs get filed against that version string, and if there's no version in a bug, we assume it cannot be reproduced without wasting time checking every version, so we reject it.  

I apologize for all the text, but maybe this helps you and Srinath see some things you aren't doing.  Please continue to ask questions until you get your questions resolved!  If we can help you, you'll eventually help others!  

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


Re: How to define local repository path in settings.xml or pom.xml?

Posted by Brian Topping <to...@codehaus.org>.
On May 21, 2011, at 10:41 PM, Ron Wheeler wrote:

> On 20/05/2011 9:06 PM, Petr V. wrote:
>> Thanks Brian for your reply.
>> 
>> Our developers work on several projects at same time using same machine. What we want is that when they build the particular project then every thing related to project goes to its own build directory (lot of output other than jars) instead of putting every thing in central m2 location.
> I think that Brian is asking "Why do you want to do this?"

Yes, that approximates what I was asking pretty well.  :-)

Petr, the only time I've ever had a mind to intentionally manipulate my repository is when I want to make sure that a new build that I am committing does not have any missing dependencies.  In other words, a build might work on my machine, but not on another machine because of a missing dependency.

The path to that happening is (for instance) if I have built a version of an artifact from source with 'mvn install', but that version does not exist in a remote repository that the build is configured to look in.  If someone else were to try this new build without a copy of my local repository, their build will fail.  

Note that this is the correct behavior!  

So by moving my repository aside and doing a build ("mv ~/.m2/respository /tmp; mvn clean install"), I am forcing my machine to grab every dependency (direct or transitive) and fail if one of those dependencies does not exist in a configured remote repository.  When it succeeds, I usually move my old repository back ("rm -rf ~.m2/repository; mv /tmp/repository ~/.m2") because the old one has a lot of dependencies from other projects that I work on but don't want to download again.

Also note that I am not saying "public repository" instead of "remote repository".  Some of the aforementioned dependencies that will be missing by some people may be dependencies that they do not have source for, but are not public dependencies either.  Hypothetically, if my company has super sekrit algorithms that we don't want the source floating around for, we might only provide binaries to most developers.  These binaries come from a *private remote repository* such as Nexus (but could just be a writable WebDAV directory) that lives *inside the firewall*.  There are tens or hundreds of thousands of these private repositories in use around the world.

If I were to guess where you and Srinath might be having problems, it's because you aren't running a private repository for your company's artifacts like this.  When I do a 'mvn install', my build only goes to my local repository, which limits any brain-damaged code to my local machine.  I do this over and over until it's ready to share, and when it's ready, I do a 'mvn deploy' to share it.  For smaller companies with no QA resources, everyone might have the credentials to deploy to a private repository, but they don't do so until they have really done their homework and are sure the artifacts are ready for their teammates to use.  

The other thing that might be happening is you aren't using the release plugin.  Teams of people need to make releases when milestones are released.  For a small company, a great milestone is "I want to push this software out to customers".  I never let snapshot builds reach a customer.  Never never never!  But if all a team creates is 1.0-SNAPSHOT versions, there's never any way to find those milestones over time.  This would be a reason to have multiple copies of a repository, but completely unnecessary if a single repository is properly creating distinct releases in a single repository.

Versions are so important that I bake the version string into every build, for instance into an admin screen.  Bugs get filed against that version string, and if there's no version in a bug, we assume it cannot be reproduced without wasting time checking every version, so we reject it.  

I apologize for all the text, but maybe this helps you and Srinath see some things you aren't doing.  Please continue to ask questions until you get your questions resolved!  If we can help you, you'll eventually help others!  

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


Re: How to define local repository path in settings.xml or pom.xml?

Posted by Ron Wheeler <rw...@artifact-software.com>.
On 20/05/2011 9:06 PM, Petr V. wrote:
> Thanks Brian for your reply.
>
> Our developers work on several projects at same time using same machine. What we want is that when they build the particular project then every thing related to project goes to its own build directory (lot of output other than jars) instead of putting every thing in central m2 location.
I think that Brian is asking "Why do you want to do this?"

It does not seem to have any obvious value .

You need to explain why you want to do this and what you want to do 
afterwards.

It may be that you are just missing a project with an assembly to pull 
together all the components.

Or it could be some other thing.

What are you doing that no other developer would want to do and why is 
your application so different from the tens of thousands of teams that 
do not need this?


Ron

> We can issue command mvn install -Dmaven.repo.local="c:\project1\build\depot" for project 1 to push all its dependencies in path specified but we want to automate it via pom file so developers does not have to pass this option to build project.
>
> Thanks,
>
>
>
> --- On Sat, 5/21/11, Brian Topping<to...@codehaus.org>  wrote:
>
> From: Brian Topping<to...@codehaus.org>
> Subject: Re: How to define local repository path in settings.xml or pom.xml?
> To: "Maven Users List"<us...@maven.apache.org>
> Date: Saturday, May 21, 2011, 4:51 AM
>
> Can you describe more about what you are specifically trying to accomplish?  Maybe the list can help better that way.
>
> In general, the location of the repository should not matter.  One of the beautiful things about Maven is it manages the location per machine automatically.  There's no need to put it in the same place for all developers, which breaks for Windows v. *nix.  And your builds plugins should not require a fixed location for the repository, rather, it should be resolved from the context sent by Maven itself.
>
> On May 20, 2011, at 4:35 PM, Petr V. wrote:
>
>> I have figured out the way to use {env.CODE_BASE} but for that each user will have to change their settings.xml.
>>
>> Is there a way, I can define localRepository in project pom file instead of settings.xml so that user does not have to define environment variable and edit their settings.xml.
>>
>> Thanks, 
>>   
>>
>>
>> --- On Sat, 5/21/11, Petr V.<gr...@yahoo.com>  wrote:
>>
>> From: Petr V.<gr...@yahoo.com>
>> Subject: How to define local repository path in settings.xml or pom.xml?
>> To: "Maven Users List"<us...@maven.apache.org>
>> Date: Saturday, May 21, 2011, 2:26 AM
>>
>> I am trying to define local repository path in settings.xml on Windows.
>>
>> I have a windows environment variable CODE_BASE=C:\mycode
>>
>> In settings.xml , I put
>>
>> <localRepository>${env.CODE_BASE}\build\local_depot</localRepository>
>>
>> But it does not read environment variable. How can I read environment variable in settings.xml.
>>
>> If that's not a possibility, can I define local repository in pom.xml of project?
>>
>> Your help will be much appreciated.
>>
>> Thanks,
>>
>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> 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: How to define local repository path in settings.xml or pom.xml?

Posted by "Petr V." <gr...@yahoo.com>.
Thanks Brian for your reply.

Our developers work on several projects at same time using same machine. What we want is that when they build the particular project then every thing related to project goes to its own build directory (lot of output other than jars) instead of putting every thing in central m2 location.

We can issue command mvn install -Dmaven.repo.local="c:\project1\build\depot" for project 1 to push all its dependencies in path specified but we want to automate it via pom file so developers does not have to pass this option to build project.

Thanks,



--- On Sat, 5/21/11, Brian Topping <to...@codehaus.org> wrote:

From: Brian Topping <to...@codehaus.org>
Subject: Re: How to define local repository path in settings.xml or pom.xml?
To: "Maven Users List" <us...@maven.apache.org>
Date: Saturday, May 21, 2011, 4:51 AM

Can you describe more about what you are specifically trying to accomplish?  Maybe the list can help better that way.

In general, the location of the repository should not matter.  One of the beautiful things about Maven is it manages the location per machine automatically.  There's no need to put it in the same place for all developers, which breaks for Windows v. *nix.  And your builds plugins should not require a fixed location for the repository, rather, it should be resolved from the context sent by Maven itself. 

On May 20, 2011, at 4:35 PM, Petr V. wrote:

> I have figured out the way to use {env.CODE_BASE} but for that each user will have to change their settings.xml. 
> 
> Is there a way, I can define localRepository in project pom file instead of settings.xml so that user does not have to define environment variable and edit their settings.xml.
> 
> Thanks,  
>  
> 
> 
> --- On Sat, 5/21/11, Petr V. <gr...@yahoo.com> wrote:
> 
> From: Petr V. <gr...@yahoo.com>
> Subject: How to define local repository path in settings.xml or pom.xml?
> To: "Maven Users List" <us...@maven.apache.org>
> Date: Saturday, May 21, 2011, 2:26 AM
> 
> I am trying to define local repository path in settings.xml on Windows.
> 
> I have a windows environment variable CODE_BASE=C:\mycode
> 
> In settings.xml , I put
> 
> <localRepository>${env.CODE_BASE}\build\local_depot</localRepository>
> 
> But it does not read environment variable. How can I read environment variable in settings.xml.
> 
> If that's not a possibility, can I define local repository in pom.xml of project?
> 
> Your help will be much appreciated.
> 
> Thanks,
> 
> 
> 
> 
> 


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


Re: How to define local repository path in settings.xml or pom.xml?

Posted by Brian Topping <to...@codehaus.org>.
Can you describe more about what you are specifically trying to accomplish?  Maybe the list can help better that way.

In general, the location of the repository should not matter.  One of the beautiful things about Maven is it manages the location per machine automatically.  There's no need to put it in the same place for all developers, which breaks for Windows v. *nix.  And your builds plugins should not require a fixed location for the repository, rather, it should be resolved from the context sent by Maven itself. 

On May 20, 2011, at 4:35 PM, Petr V. wrote:

> I have figured out the way to use {env.CODE_BASE} but for that each user will have to change their settings.xml. 
> 
> Is there a way, I can define localRepository in project pom file instead of settings.xml so that user does not have to define environment variable and edit their settings.xml.
> 
> Thanks,  
>  
> 
> 
> --- On Sat, 5/21/11, Petr V. <gr...@yahoo.com> wrote:
> 
> From: Petr V. <gr...@yahoo.com>
> Subject: How to define local repository path in settings.xml or pom.xml?
> To: "Maven Users List" <us...@maven.apache.org>
> Date: Saturday, May 21, 2011, 2:26 AM
> 
> I am trying to define local repository path in settings.xml on Windows.
> 
> I have a windows environment variable CODE_BASE=C:\mycode
> 
> In settings.xml , I put
> 
> <localRepository>${env.CODE_BASE}\build\local_depot</localRepository>
> 
> But it does not read environment variable. How can I read environment variable in settings.xml.
> 
> If that's not a possibility, can I define local repository in pom.xml of project?
> 
> Your help will be much appreciated.
> 
> Thanks,
> 
> 
> 
> 
> 


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


Re: How to define local repository path in settings.xml or pom.xml?

Posted by "Petr V." <gr...@yahoo.com>.
I have figured out the way to use {env.CODE_BASE} but for that each user will have to change their settings.xml. 

Is there a way, I can define localRepository in project pom file instead of settings.xml so that user does not have to define environment variable and edit their settings.xml.

Thanks,  
 


--- On Sat, 5/21/11, Petr V. <gr...@yahoo.com> wrote:

From: Petr V. <gr...@yahoo.com>
Subject: How to define local repository path in settings.xml or pom.xml?
To: "Maven Users List" <us...@maven.apache.org>
Date: Saturday, May 21, 2011, 2:26 AM

I am trying to define local repository path in settings.xml on Windows.

I have a windows environment variable CODE_BASE=C:\mycode

In settings.xml , I put

<localRepository>${env.CODE_BASE}\build\local_depot</localRepository>

But it does not read environment variable. How can I read environment variable in settings.xml.

If that's not a possibility, can I define local repository in pom.xml of project?

Your help will be much appreciated.

Thanks,






How to define local repository path in settings.xml or pom.xml?

Posted by "Petr V." <gr...@yahoo.com>.
I am trying to define local repository path in settings.xml on Windows.

I have a windows environment variable CODE_BASE=C:\mycode

In settings.xml , I put

<localRepository>${env.CODE_BASE}\build\local_depot</localRepository>

But it does not read environment variable. How can I read environment variable in settings.xml.

If that's not a possibility, can I define local repository in pom.xml of project?

Your help will be much appreciated.

Thanks,






Re: Looking for a pom property that stores the deploy URL

Posted by Wendy Smoak <ws...@gmail.com>.
On Fri, May 20, 2011 at 5:02 PM, Freeman, Brian
<Br...@libertymutual.com> wrote:
> Here is my issue: I am currently using Maven with Nexus to save our build artifacts.  After we create the artifact and it has been deployed out to Nexus I would like to run an Ant script that we use to publish the URL as part of a build result.

Establish a property in the pom, and use it in both
distributionManagement and the snippet where you need to publish it.
You'll have to construct the download url by stringing together the
groupId (with slashes instead of dots) the artifact Id and version.
Most of that can be done with the available properties.

-- 
Wendy

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


Re: Looking for a pom property that stores the deploy URL

Posted by Anders Hammar <an...@hammar.net>.
No. But I do know a Nexus specific url (REST call) which you can use by
populating it with groupId, artifactId and version [1].

/Anders

[1]
https://docs.sonatype.com/display/SPRTNXOSS/Nexus+FAQ#NexusFAQ-Q.HowcanIretrieveasnapshotifIdon%27tknowtheexactfilename%3F

On Fri, May 20, 2011 at 23:02, Freeman, Brian <
Brian.Freeman@libertymutual.com> wrote:

> Hi,
>
> Sorry to bother everyone, but I've looked online and have been looking at
> the Maven source code for a while and still haven't figured this out.  Any
> help you could give is greatly appreciated!
>
> Here is my issue: I am currently using Maven with Nexus to save our build
> artifacts.  After we create the artifact and it has been deployed out to
> Nexus I would like to run an Ant script that we use to publish the URL as
> part of a build result.
>
> The output from running maven prints the URL several times, for example:
>
> [INFO] --- maven-deploy-plugin:2.5:deploy (default-deploy) @
> PmInetAutoQuoteClient ---
> Uploading:
> http://nexus.mydomain.com/content/repositories/releases/com/mydomain/test/TestProject/1.0.0/TestProject-1.0.0.zip
> Uploaded:
> http://nexus.mydomain.com/content/repositories/releases/com/mydomain/test/TestProject/1.0.0/TestProject-1.0.0.zip(1717 KB at 2058.3 KB/sec)
>
> Here is the ant call I'm running, I basically want to replace ${nexusUrl}
> with something like ${project.deploy.url}
>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-antrun-plugin</artifactId>
> <execution>
>                <!-- Adds a link to the deployed zip directory out on Nexus
> -->
>                <id>rtcLinkPublisher</id>
>                <phase>deploy</phase>
>                <configuration>
>                        <tasks>
>                                <taskdef name="linkPublisher"
>
>  classname="com.ibm.team.build.ant.task.LinkPublisherTask">
>                                        <classpath>
>                                                <fileset
> dir="/opt/IBM/jazz/buildsystem/buildtoolkit">
>                                                        <include
> name="*.jar" />
>                                                </fileset>
>                                        </classpath>
>                                </taskdef>
>                                <echo>nexusUrl: ${nexusUrl}</echo>
>                                <!--
>                                        uname/pwd need to be set in your
> settings.xml
>                                        repositoryAddress and
> buildResultUUID are passed in by the
>                                        buildEngine
>                                -->
>                                <linkPublisher
> repositoryAddress="${repositoryAddress}"
>                                        userId="${rtc.username}"
> passwordFile="${rtc.passwordFile}"
>                                        buildResultUUID="${buildResultUUID}"
> url="${nexusUrl}" label="${nexusUrl}"
>                                        failOnError="false" />
>                        </tasks>
>                </configuration>
>                <goals>
>                        <goal>run</goal>
>                </goals>
> </execution>
>
>
> Does anyone have any ideas or know of a way for me to access this URL via
> the POM so I can add it to the ant call?
>
> Thanks,
> Brian
>
>