You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jérémy <me...@gmail.com> on 2011/05/23 10:15:32 UTC

Repositories in settings.xml

Hi,

I noticed a weird behavior with the versions resolution of Maven 3.0.3.
Here's my setup: I use Nexus and have a first repository group containing
release and snapshots versions and a second repository group with only
snapshots.
When I want to release a product, I want to pick only the release versions
of the first repository group and snapshots versions of the second
repository group.
In my settings.xml, I have a profile with the following configurations:
<repositories>
<repository>
<id>public</id>
<url>http://artifacts/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>allowed-snapshots</id>
<url>http://artifacts/content/groups/allowed-snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
With this configuration, Maven picks up snapshots from the public
repository. However if I remove the second repository, the resolution works
as attended. It seems that the enabled variable acts as a global variable
across settings.xml. Is that a bug?

Cheers,
Jérémy

Re: Repositories in settings.xml

Posted by Jérémy <me...@gmail.com>.
Hi Ron,

Thanks for your advices! I grouped all the repos in a single group so the
developers just have to point to a single group repo for development and
release. But I am considering to split that in several group repos to make
it cleaner :-)

Anyway I opened an issue for my problem, I believe that it is a bug.

Cheers,
Jérémy

On Tue, May 24, 2011 at 6:33 PM, Ron Wheeler <rwheeler@artifact-software.com
> wrote:

> On 24/05/2011 3:24 AM, Jérémy wrote:
>
>> Hi Ron, thanks for your answer,
>>
>> How are builds repeatable in your case?
>>
> Production builds are only allowed to only depend on releases.
> Releases are immutable.
> If we rebuild a released artifact it will contain exactly the same
> dependencies each time.
>
>  The people looking after QA and support have a great deal of difficulty
>>> saying what was in a build if you use SNAPSHOTS.
>>>
>>>  In the corporate pom, I try to change only plugins configuration for
>> stuff
>> that does not involve the jar (aka javadoc, attached-sources, etc...)
>>
>>
>>  Why is your corporate POM so unstable?
>>>
>>
>> We're still in migration process, we're moving away from a in-house build
>> tool. Because of the amount of projects, the migration might take more
>> than
>> a year... so to ease the updates (because new requirements will come up
>> all
>> the time), I'd like to keep the parent-pom as SNAPSHOT.
>>
>>  You might find it easier to use an application specific parent. You will
> need more but at least, you can stabilize each application as you get it
> "Mavenized".
>
>
>  Anders asked for a specific piece of information.
>>>
>>
>>  The effective-pom shows the exact same piece of configuration I sent:
>> <repositories>
>> <repository>
>> <id>public</id>
>> <url>http://artifacts/content/groups/public</url>
>> <releases>
>> <enabled>true</enabled>
>> </releases>
>> <snapshots>
>> <enabled>false</enabled>
>> </snapshots>
>> </repository>
>> <repository>
>> <id>allowed-snapshots</id>
>> <url>http://artifacts/content/groups/allowed-snapshots/</url>
>> <snapshots>
>> <enabled>true</enabled>
>> </snapshots>
>> </repository>
>> </repositories>
>>
>>
>> So my question is, why does Maven fetch SNAPSHOTS from the first
>> repository?
>>
>>  Another interesting question is why are there SAPSHOTs in the first
> repository?
> One generally separates Releases from SNAPSHOTS
>
> I hope that all this helps move the problem forward.
>
> Ron
>
>  Cheers,
>> Jérémy
>>
>>
>>   Cheers,
>>>
>>>> Jérémy
>>>>
>>>> On Mon, May 23, 2011 at 10:24 AM, Anders Hammar<an...@hammar.net>
>>>>  wrote:
>>>>
>>>>  Check the effective pom to see what Maven is working on. This will show
>>>>
>>>>> what
>>>>> repositories are enabled and how configured.
>>>>>
>>>>> mvn help:effective-pom -P theprofileyoursusing
>>>>>
>>>>> But, I seriously wonder why you would like to use a snapshot repo when
>>>>> doing
>>>>> a release. A release should never use snapshots.
>>>>>
>>>>> /Anders
>>>>>
>>>>> On Mon, May 23, 2011 at 10:15, Jérémy<me...@gmail.com>   wrote:
>>>>>
>>>>>  Hi,
>>>>>
>>>>>> I noticed a weird behavior with the versions resolution of Maven
>>>>>> 3.0.3.
>>>>>> Here's my setup: I use Nexus and have a first repository group
>>>>>> containing
>>>>>> release and snapshots versions and a second repository group with only
>>>>>> snapshots.
>>>>>> When I want to release a product, I want to pick only the release
>>>>>>
>>>>>>  versions
>>>>>
>>>>>  of the first repository group and snapshots versions of the second
>>>>>> repository group.
>>>>>> In my settings.xml, I have a profile with the following
>>>>>> configurations:
>>>>>> <repositories>
>>>>>> <repository>
>>>>>> <id>public</id>
>>>>>> <url>http://artifacts/content/groups/public</url>
>>>>>> <releases>
>>>>>> <enabled>true</enabled>
>>>>>> </releases>
>>>>>> <snapshots>
>>>>>> <enabled>false</enabled>
>>>>>> </snapshots>
>>>>>> </repository>
>>>>>> <repository>
>>>>>> <id>allowed-snapshots</id>
>>>>>> <url>http://artifacts/content/groups/allowed-snapshots/</url>
>>>>>> <snapshots>
>>>>>> <enabled>true</enabled>
>>>>>> </snapshots>
>>>>>> </repository>
>>>>>> </repositories>
>>>>>> With this configuration, Maven picks up snapshots from the public
>>>>>> repository. However if I remove the second repository, the resolution
>>>>>>
>>>>>>  works
>>>>>
>>>>>  as attended. It seems that the enabled variable acts as a global
>>>>>> variable
>>>>>> across settings.xml. Is that a bug?
>>>>>>
>>>>>> Cheers,
>>>>>> Jérémy
>>>>>>
>>>>>>
>>>>>>  ---------------------------------------------------------------------
>>> 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: Repositories in settings.xml

Posted by Ron Wheeler <rw...@artifact-software.com>.
On 24/05/2011 3:24 AM, Jérémy wrote:
> Hi Ron, thanks for your answer,
>
> How are builds repeatable in your case?
Production builds are only allowed to only depend on releases.
Releases are immutable.
If we rebuild a released artifact it will contain exactly the same 
dependencies each time.
>> The people looking after QA and support have a great deal of difficulty
>> saying what was in a build if you use SNAPSHOTS.
>>
> In the corporate pom, I try to change only plugins configuration for stuff
> that does not involve the jar (aka javadoc, attached-sources, etc...)
>
>
>> Why is your corporate POM so unstable?
>
> We're still in migration process, we're moving away from a in-house build
> tool. Because of the amount of projects, the migration might take more than
> a year... so to ease the updates (because new requirements will come up all
> the time), I'd like to keep the parent-pom as SNAPSHOT.
>
You might find it easier to use an application specific parent. You will 
need more but at least, you can stabilize each application as you get it 
"Mavenized".

>> Anders asked for a specific piece of information.
>
>   The effective-pom shows the exact same piece of configuration I sent:
> <repositories>
> <repository>
> <id>public</id>
> <url>http://artifacts/content/groups/public</url>
> <releases>
> <enabled>true</enabled>
> </releases>
> <snapshots>
> <enabled>false</enabled>
> </snapshots>
> </repository>
> <repository>
> <id>allowed-snapshots</id>
> <url>http://artifacts/content/groups/allowed-snapshots/</url>
> <snapshots>
> <enabled>true</enabled>
> </snapshots>
> </repository>
> </repositories>
>
>
> So my question is, why does Maven fetch SNAPSHOTS from the first repository?
>
Another interesting question is why are there SAPSHOTs in the first 
repository?
One generally separates Releases from SNAPSHOTS

I hope that all this helps move the problem forward.

Ron
> Cheers,
> Jérémy
>
>
>>   Cheers,
>>> Jérémy
>>>
>>> On Mon, May 23, 2011 at 10:24 AM, Anders Hammar<an...@hammar.net>
>>>   wrote:
>>>
>>>   Check the effective pom to see what Maven is working on. This will show
>>>> what
>>>> repositories are enabled and how configured.
>>>>
>>>> mvn help:effective-pom -P theprofileyoursusing
>>>>
>>>> But, I seriously wonder why you would like to use a snapshot repo when
>>>> doing
>>>> a release. A release should never use snapshots.
>>>>
>>>> /Anders
>>>>
>>>> On Mon, May 23, 2011 at 10:15, Jérémy<me...@gmail.com>   wrote:
>>>>
>>>>   Hi,
>>>>> I noticed a weird behavior with the versions resolution of Maven 3.0.3.
>>>>> Here's my setup: I use Nexus and have a first repository group
>>>>> containing
>>>>> release and snapshots versions and a second repository group with only
>>>>> snapshots.
>>>>> When I want to release a product, I want to pick only the release
>>>>>
>>>> versions
>>>>
>>>>> of the first repository group and snapshots versions of the second
>>>>> repository group.
>>>>> In my settings.xml, I have a profile with the following configurations:
>>>>> <repositories>
>>>>> <repository>
>>>>> <id>public</id>
>>>>> <url>http://artifacts/content/groups/public</url>
>>>>> <releases>
>>>>> <enabled>true</enabled>
>>>>> </releases>
>>>>> <snapshots>
>>>>> <enabled>false</enabled>
>>>>> </snapshots>
>>>>> </repository>
>>>>> <repository>
>>>>> <id>allowed-snapshots</id>
>>>>> <url>http://artifacts/content/groups/allowed-snapshots/</url>
>>>>> <snapshots>
>>>>> <enabled>true</enabled>
>>>>> </snapshots>
>>>>> </repository>
>>>>> </repositories>
>>>>> With this configuration, Maven picks up snapshots from the public
>>>>> repository. However if I remove the second repository, the resolution
>>>>>
>>>> works
>>>>
>>>>> as attended. It seems that the enabled variable acts as a global
>>>>> variable
>>>>> across settings.xml. Is that a bug?
>>>>>
>>>>> Cheers,
>>>>> Jérémy
>>>>>
>>>>>
>> ---------------------------------------------------------------------
>> 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: Repositories in settings.xml

Posted by Jérémy <me...@gmail.com>.
Hi Ron, thanks for your answer,

How are builds repeatable in your case?
> The people looking after QA and support have a great deal of difficulty
> saying what was in a build if you use SNAPSHOTS.
>

In the corporate pom, I try to change only plugins configuration for stuff
that does not involve the jar (aka javadoc, attached-sources, etc...)


>
> Why is your corporate POM so unstable?


We're still in migration process, we're moving away from a in-house build
tool. Because of the amount of projects, the migration might take more than
a year... so to ease the updates (because new requirements will come up all
the time), I'd like to keep the parent-pom as SNAPSHOT.


> Anders asked for a specific piece of information.


 The effective-pom shows the exact same piece of configuration I sent:
<repositories>
<repository>
<id>public</id>
<url>http://artifacts/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>allowed-snapshots</id>
<url>http://artifacts/content/groups/allowed-snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>


So my question is, why does Maven fetch SNAPSHOTS from the first repository?

Cheers,
Jérémy


>  Cheers,
>> Jérémy
>>
>> On Mon, May 23, 2011 at 10:24 AM, Anders Hammar<an...@hammar.net>
>>  wrote:
>>
>>  Check the effective pom to see what Maven is working on. This will show
>>> what
>>> repositories are enabled and how configured.
>>>
>>> mvn help:effective-pom -P theprofileyoursusing
>>>
>>> But, I seriously wonder why you would like to use a snapshot repo when
>>> doing
>>> a release. A release should never use snapshots.
>>>
>>> /Anders
>>>
>>> On Mon, May 23, 2011 at 10:15, Jérémy<me...@gmail.com>  wrote:
>>>
>>>  Hi,
>>>>
>>>> I noticed a weird behavior with the versions resolution of Maven 3.0.3.
>>>> Here's my setup: I use Nexus and have a first repository group
>>>> containing
>>>> release and snapshots versions and a second repository group with only
>>>> snapshots.
>>>> When I want to release a product, I want to pick only the release
>>>>
>>> versions
>>>
>>>> of the first repository group and snapshots versions of the second
>>>> repository group.
>>>> In my settings.xml, I have a profile with the following configurations:
>>>> <repositories>
>>>> <repository>
>>>> <id>public</id>
>>>> <url>http://artifacts/content/groups/public</url>
>>>> <releases>
>>>> <enabled>true</enabled>
>>>> </releases>
>>>> <snapshots>
>>>> <enabled>false</enabled>
>>>> </snapshots>
>>>> </repository>
>>>> <repository>
>>>> <id>allowed-snapshots</id>
>>>> <url>http://artifacts/content/groups/allowed-snapshots/</url>
>>>> <snapshots>
>>>> <enabled>true</enabled>
>>>> </snapshots>
>>>> </repository>
>>>> </repositories>
>>>> With this configuration, Maven picks up snapshots from the public
>>>> repository. However if I remove the second repository, the resolution
>>>>
>>> works
>>>
>>>> as attended. It seems that the enabled variable acts as a global
>>>> variable
>>>> across settings.xml. Is that a bug?
>>>>
>>>> Cheers,
>>>> Jérémy
>>>>
>>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Repositories in settings.xml

Posted by Ron Wheeler <rw...@artifact-software.com>.
On 23/05/2011 5:10 AM, Jérémy wrote:
> Hi Anders,
>
> Hehe I knew that this question would pop-up:
> I have a corporate pom which I keep as SNAPSHOT version. So I can update it
> and it is transparent to the users. In my organization we have a huge amount
> of projects, I can't imagine to ask them to update the version of the
> parent-pom at each update. Unfortunately it's not possible to declare a
> parent-pom with a version range.
How are builds repeatable in your case?
The people looking after QA and support have a great deal of difficulty 
saying what was in a build if you use SNAPSHOTS.

Why is your corporate POM so unstable?

> Back to my initial question, the effective-pom has the same configuration as
> the one I showed you. I clean up my local repository each time before
> resolving the dependencies.
>
> Any clue?
>
Anders asked for a specific piece of information.
> Cheers,
> Jérémy
>
> On Mon, May 23, 2011 at 10:24 AM, Anders Hammar<an...@hammar.net>  wrote:
>
>> Check the effective pom to see what Maven is working on. This will show
>> what
>> repositories are enabled and how configured.
>>
>> mvn help:effective-pom -P theprofileyoursusing
>>
>> But, I seriously wonder why you would like to use a snapshot repo when
>> doing
>> a release. A release should never use snapshots.
>>
>> /Anders
>>
>> On Mon, May 23, 2011 at 10:15, Jérémy<me...@gmail.com>  wrote:
>>
>>> Hi,
>>>
>>> I noticed a weird behavior with the versions resolution of Maven 3.0.3.
>>> Here's my setup: I use Nexus and have a first repository group containing
>>> release and snapshots versions and a second repository group with only
>>> snapshots.
>>> When I want to release a product, I want to pick only the release
>> versions
>>> of the first repository group and snapshots versions of the second
>>> repository group.
>>> In my settings.xml, I have a profile with the following configurations:
>>> <repositories>
>>> <repository>
>>> <id>public</id>
>>> <url>http://artifacts/content/groups/public</url>
>>> <releases>
>>> <enabled>true</enabled>
>>> </releases>
>>> <snapshots>
>>> <enabled>false</enabled>
>>> </snapshots>
>>> </repository>
>>> <repository>
>>> <id>allowed-snapshots</id>
>>> <url>http://artifacts/content/groups/allowed-snapshots/</url>
>>> <snapshots>
>>> <enabled>true</enabled>
>>> </snapshots>
>>> </repository>
>>> </repositories>
>>> With this configuration, Maven picks up snapshots from the public
>>> repository. However if I remove the second repository, the resolution
>> works
>>> as attended. It seems that the enabled variable acts as a global variable
>>> across settings.xml. Is that a bug?
>>>
>>> Cheers,
>>> Jérémy
>>>


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


Re: Repositories in settings.xml

Posted by Jérémy <me...@gmail.com>.
Hi Anders,

Hehe I knew that this question would pop-up:
I have a corporate pom which I keep as SNAPSHOT version. So I can update it
and it is transparent to the users. In my organization we have a huge amount
of projects, I can't imagine to ask them to update the version of the
parent-pom at each update. Unfortunately it's not possible to declare a
parent-pom with a version range.

Back to my initial question, the effective-pom has the same configuration as
the one I showed you. I clean up my local repository each time before
resolving the dependencies.

Any clue?

Cheers,
Jérémy

On Mon, May 23, 2011 at 10:24 AM, Anders Hammar <an...@hammar.net> wrote:

> Check the effective pom to see what Maven is working on. This will show
> what
> repositories are enabled and how configured.
>
> mvn help:effective-pom -P theprofileyoursusing
>
> But, I seriously wonder why you would like to use a snapshot repo when
> doing
> a release. A release should never use snapshots.
>
> /Anders
>
> On Mon, May 23, 2011 at 10:15, Jérémy <me...@gmail.com> wrote:
>
> > Hi,
> >
> > I noticed a weird behavior with the versions resolution of Maven 3.0.3.
> > Here's my setup: I use Nexus and have a first repository group containing
> > release and snapshots versions and a second repository group with only
> > snapshots.
> > When I want to release a product, I want to pick only the release
> versions
> > of the first repository group and snapshots versions of the second
> > repository group.
> > In my settings.xml, I have a profile with the following configurations:
> > <repositories>
> > <repository>
> > <id>public</id>
> > <url>http://artifacts/content/groups/public</url>
> > <releases>
> > <enabled>true</enabled>
> > </releases>
> > <snapshots>
> > <enabled>false</enabled>
> > </snapshots>
> > </repository>
> > <repository>
> > <id>allowed-snapshots</id>
> > <url>http://artifacts/content/groups/allowed-snapshots/</url>
> > <snapshots>
> > <enabled>true</enabled>
> > </snapshots>
> > </repository>
> > </repositories>
> > With this configuration, Maven picks up snapshots from the public
> > repository. However if I remove the second repository, the resolution
> works
> > as attended. It seems that the enabled variable acts as a global variable
> > across settings.xml. Is that a bug?
> >
> > Cheers,
> > Jérémy
> >
>

Re: Repositories in settings.xml

Posted by Anders Hammar <an...@hammar.net>.
Check the effective pom to see what Maven is working on. This will show what
repositories are enabled and how configured.

mvn help:effective-pom -P theprofileyoursusing

But, I seriously wonder why you would like to use a snapshot repo when doing
a release. A release should never use snapshots.

/Anders

On Mon, May 23, 2011 at 10:15, Jérémy <me...@gmail.com> wrote:

> Hi,
>
> I noticed a weird behavior with the versions resolution of Maven 3.0.3.
> Here's my setup: I use Nexus and have a first repository group containing
> release and snapshots versions and a second repository group with only
> snapshots.
> When I want to release a product, I want to pick only the release versions
> of the first repository group and snapshots versions of the second
> repository group.
> In my settings.xml, I have a profile with the following configurations:
> <repositories>
> <repository>
> <id>public</id>
> <url>http://artifacts/content/groups/public</url>
> <releases>
> <enabled>true</enabled>
> </releases>
> <snapshots>
> <enabled>false</enabled>
> </snapshots>
> </repository>
> <repository>
> <id>allowed-snapshots</id>
> <url>http://artifacts/content/groups/allowed-snapshots/</url>
> <snapshots>
> <enabled>true</enabled>
> </snapshots>
> </repository>
> </repositories>
> With this configuration, Maven picks up snapshots from the public
> repository. However if I remove the second repository, the resolution works
> as attended. It seems that the enabled variable acts as a global variable
> across settings.xml. Is that a bug?
>
> Cheers,
> Jérémy
>