The reason is simple:

Maven needs at least one snapshot repo configured, or it won't even
attempt to ask anyone (specifically Nexus via the mirrorOf * setting)
for any snapshots. Maven has built in an existing repository with the
ID central but it is enabled only for releases. We must do either: 1)
define another repo as snapshot only, or 2) enable snapshots for the
built in central id. The example chooses 2. We could have used 1, but
since I put in the example from years of habit, that's what stuck ;-)

You'll also note that I like to redefine the url as well so that when
maven spits out what it's doing, it's immediately apparent if my
settings are ignored or not.

On Mon, Aug 23, 2010 at 2:36 PM, ChadDavis <[email protected]> wrote:
>> <profiles>
>> <profile>
>> <id>nexus</id>
>> <!--Enable snapshots for the built in central repo to direct -->
>> <!--all requests to nexus via the mirror -->
>> <repositories>
>> <repository>
>> <id>central</id>
>> <url>http://central</url>
>> <releases><enabled>true</enabled></releases>
>> <snapshots><enabled>true</enabled></snapshots>
>> </repository>
>> </repositories>
>> <pluginRepositories>
>> <pluginRepository>
>> <id>central</id>
>> <url>http://central</url>
>> <releases><enabled>true</enabled></releases>
>> <snapshots><enabled>true</enabled></snapshots>
>> </pluginRepository>
>> </pluginRepositories>
>> </profile>
>> </profiles>
>> <activeProfiles>
>> <!--make the profile active all the time -->
>> <activeProfile>nexus</activeProfile>
>> </activeProfiles>
>> </settings>
>>
>
> Thanks for the responses.  I'm still confused about the "logic" of
> that profile element in the settings.xml.  It sets up a mock central
> repo, for both plugins and artifacts, and enables snapshots and
> releases on this central mock.  Can someone illuminate what is going
> on there?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to