You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "midnight.codder" <mi...@gmail.com> on 2008/10/06 23:04:38 UTC

How to use Maven with multiple repositories?

I have read the setting reference and the POM reference probably a gazillion
times and searched this forum for similar posts, and even found them (!) but
the solution proposed therein did not work for me at all.

We are using Archiva as our internal repository. On Archiva we have 3
repositories, 2 for third party artifacts (one for snapshot and one for
releases) and one for our artifacts (we have just began and just trying to
get up and running, so releases and snapshot at still together).
I can get the deploy goal to deploy my artifact to my group's repository.
But my colleague cannot compile his module which depends on the artifact I
just deployed.

I declared those repositories in repositories tags in a profile tag and
activated it in the setting.xml (attached) - but it makes no difference.
Maven can't locate the artifact.

A very confusing paragraph in the setting reference got me thinking that I
just don't understand Maven enough or have problems with reading
comprehension (or both):

The final piece of the settings.xml puzzle is the activeProfiles element.
This contains a set of activeProfile elements, which each have a value of a
profile id. Any profile id defined as an activeProfile will be active,
reguardless of any environment settings. If no matching profile is found
nothing will happen. For example, if env-test is an activeProfile, a profile
in a pom.xml (or profile.xml with a corrosponding id will be active. If no
such profile is found then execution will continue as normal.

So I thought maybe I am missing a profile tag in the pom.xml of my project.
I tried adding that but it did not do squat.

setting.xml is attached and the project's pom.xml too.
A link to a very similar post (to the best of my understanding I tried the
solution, but no success):
http://www.nabble.com/-m2--multiple-repository-confusion-td978358.html#a978358

Thanks.
http://www.nabble.com/file/p19846425/settings.xml settings.xml 
http://www.nabble.com/file/p19846425/pom.xml pom.xml 

-- 
View this message in context: http://www.nabble.com/How-to-use-Maven-with-multiple-repositories--tp19846425p19846425.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: How to use Maven with multiple repositories?

Posted by "midnight.codder" <mi...@gmail.com>.
Thanks Brett,

I started from the second option but it did not work.

However using the repositories group (called virtual repository in Archiva)
worked like a charm.

We are now one step closer to a happier and smooth sailing build!

Thanks.


Brett Porter wrote:
> 
> Because of the mirror setting, everything is going to be redirected to
> your internal repository.
> 
> You have two options:
> 1) point this to a group on the server, and have that group dictate
> which repositories are used
> 2) add additional mirrors for different repositories (they are keyed by
> the ID).
> 
> Hope that helps.
> 
> Cheers,
> Brett
> 
> 2008/10/7 midnight.codder <mi...@gmail.com>:
>>
>> I have read the setting reference and the POM reference probably a
>> gazillion
>> times and searched this forum for similar posts, and even found them (!)
>> but
>> the solution proposed therein did not work for me at all.
>>
>> We are using Archiva as our internal repository. On Archiva we have 3
>> repositories, 2 for third party artifacts (one for snapshot and one for
>> releases) and one for our artifacts (we have just began and just trying
>> to
>> get up and running, so releases and snapshot at still together).
>> I can get the deploy goal to deploy my artifact to my group's repository.
>> But my colleague cannot compile his module which depends on the artifact
>> I
>> just deployed.
>>
>> I declared those repositories in repositories tags in a profile tag and
>> activated it in the setting.xml (attached) - but it makes no difference.
>> Maven can't locate the artifact.
>>
>> A very confusing paragraph in the setting reference got me thinking that
>> I
>> just don't understand Maven enough or have problems with reading
>> comprehension (or both):
>>
>> The final piece of the settings.xml puzzle is the activeProfiles element.
>> This contains a set of activeProfile elements, which each have a value of
>> a
>> profile id. Any profile id defined as an activeProfile will be active,
>> reguardless of any environment settings. If no matching profile is found
>> nothing will happen. For example, if env-test is an activeProfile, a
>> profile
>> in a pom.xml (or profile.xml with a corrosponding id will be active. If
>> no
>> such profile is found then execution will continue as normal.
>>
>> So I thought maybe I am missing a profile tag in the pom.xml of my
>> project.
>> I tried adding that but it did not do squat.
>>
>> setting.xml is attached and the project's pom.xml too.
>> A link to a very similar post (to the best of my understanding I tried
>> the
>> solution, but no success):
>> http://www.nabble.com/-m2--multiple-repository-confusion-td978358.html#a978358
>>
>> Thanks.
>> http://www.nabble.com/file/p19846425/settings.xml settings.xml
>> http://www.nabble.com/file/p19846425/pom.xml pom.xml
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-use-Maven-with-multiple-repositories--tp19846425p19846425.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 
> 
> -- 
> Brett Porter
> Blog: http://blogs.exist.com/bporter/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-use-Maven-with-multiple-repositories--tp19846425p19881419.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: How to use Maven with multiple repositories?

Posted by Brett Porter <br...@gmail.com>.
Because of the mirror setting, everything is going to be redirected to
your internal repository.

You have two options:
1) point this to a group on the server, and have that group dictate
which repositories are used
2) add additional mirrors for different repositories (they are keyed by the ID).

Hope that helps.

Cheers,
Brett

2008/10/7 midnight.codder <mi...@gmail.com>:
>
> I have read the setting reference and the POM reference probably a gazillion
> times and searched this forum for similar posts, and even found them (!) but
> the solution proposed therein did not work for me at all.
>
> We are using Archiva as our internal repository. On Archiva we have 3
> repositories, 2 for third party artifacts (one for snapshot and one for
> releases) and one for our artifacts (we have just began and just trying to
> get up and running, so releases and snapshot at still together).
> I can get the deploy goal to deploy my artifact to my group's repository.
> But my colleague cannot compile his module which depends on the artifact I
> just deployed.
>
> I declared those repositories in repositories tags in a profile tag and
> activated it in the setting.xml (attached) - but it makes no difference.
> Maven can't locate the artifact.
>
> A very confusing paragraph in the setting reference got me thinking that I
> just don't understand Maven enough or have problems with reading
> comprehension (or both):
>
> The final piece of the settings.xml puzzle is the activeProfiles element.
> This contains a set of activeProfile elements, which each have a value of a
> profile id. Any profile id defined as an activeProfile will be active,
> reguardless of any environment settings. If no matching profile is found
> nothing will happen. For example, if env-test is an activeProfile, a profile
> in a pom.xml (or profile.xml with a corrosponding id will be active. If no
> such profile is found then execution will continue as normal.
>
> So I thought maybe I am missing a profile tag in the pom.xml of my project.
> I tried adding that but it did not do squat.
>
> setting.xml is attached and the project's pom.xml too.
> A link to a very similar post (to the best of my understanding I tried the
> solution, but no success):
> http://www.nabble.com/-m2--multiple-repository-confusion-td978358.html#a978358
>
> Thanks.
> http://www.nabble.com/file/p19846425/settings.xml settings.xml
> http://www.nabble.com/file/p19846425/pom.xml pom.xml
>
> --
> View this message in context: http://www.nabble.com/How-to-use-Maven-with-multiple-repositories--tp19846425p19846425.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>



-- 
Brett Porter
Blog: http://blogs.exist.com/bporter/

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