You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by amaresh mourya <am...@gmail.com> on 2010/08/04 10:02:15 UTC

How to get list of repositories referred by a pom.xml, including repos from its ancestors

Hi All,

How to get list of repositories referred by a pom.xml, I want all
repositories explicitly written in this pom and all of its ancestors.
I have just been able to find MavenProject.getRepositories() method for my
requirement, but if there are some change in parents repositories set
between to successive calls of getRepositories(), I am not able to find
changed set, reason being it stores resolved artifacts( here parent's) in
project cache, and second time it doesn't go for again reading parent's
pom.xml.

Which method can give me, all repositories referred by a pom.xml, each time
resolving all its parents. Because in my use case all pom.xmls are supposed
to be changed anytime.

Thanks,
Amaresh

Re: How to get list of repositories referred by a pom.xml, including repos from its ancestors

Posted by Brian Fox <br...@infinity.nu>.
I added a goal to the dependency plugin a month or so ago to make it
easier to dump out the full list of repos used by a build:

mvn org.apache.maven.plugins:maven-dependency-plugin:2.2-SNAPSHOT:list-repositories


On Wed, Aug 4, 2010 at 8:56 AM, Ron Wheeler
<rw...@artifact-software.com> wrote:
>  On 04/08/2010 4:02 AM, amaresh mourya wrote:
>>
>> Hi All,
>>
>> How to get list of repositories referred by a pom.xml, I want all
>> repositories explicitly written in this pom and all of its ancestors.
>> I have just been able to find MavenProject.getRepositories() method for my
>> requirement, but if there are some change in parents repositories set
>> between to successive calls of getRepositories(), I am not able to find
>> changed set, reason being it stores resolved artifacts( here parent's) in
>> project cache, and second time it doesn't go for again reading parent's
>> pom.xml.
>>
>> Which method can give me, all repositories referred by a pom.xml, each
>> time
>> resolving all its parents. Because in my use case all pom.xmls are
>> supposed
>> to be changed anytime.
>>
>> Thanks,
>> Amaresh
>>
>
> There may be a more controlled way to do this.
> Install a repo in your company without proxy so that all builds are done
> from your repository and you can control what is in the repository.
>
> What is the ultimate problem that you are trying to solve?
> It looks like you are attacking the symptom rather than the ultimate problem
> and ending up doing a lot of work for a less than satisfactory result that
> requires a lot more reporting and gives much less certainty.
>
> Ron
>
>
> ---------------------------------------------------------------------
> 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 get list of repositories referred by a pom.xml, including repos from its ancestors

Posted by Ron Wheeler <rw...@artifact-software.com>.
  On 04/08/2010 4:02 AM, amaresh mourya wrote:
> Hi All,
>
> How to get list of repositories referred by a pom.xml, I want all
> repositories explicitly written in this pom and all of its ancestors.
> I have just been able to find MavenProject.getRepositories() method for my
> requirement, but if there are some change in parents repositories set
> between to successive calls of getRepositories(), I am not able to find
> changed set, reason being it stores resolved artifacts( here parent's) in
> project cache, and second time it doesn't go for again reading parent's
> pom.xml.
>
> Which method can give me, all repositories referred by a pom.xml, each time
> resolving all its parents. Because in my use case all pom.xmls are supposed
> to be changed anytime.
>
> Thanks,
> Amaresh
>

There may be a more controlled way to do this.
Install a repo in your company without proxy so that all builds are done 
from your repository and you can control what is in the repository.

What is the ultimate problem that you are trying to solve?
It looks like you are attacking the symptom rather than the ultimate 
problem and ending up doing a lot of work for a less than satisfactory 
result that requires a lot more reporting and gives much less certainty.

Ron


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