You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by ChadDavis <ch...@gmail.com> on 2010/08/23 18:45:01 UTC

central repo, snapshots and releases

I'm reading the Nexus book.  It describes how a given repository is
either for releases or snapshots.  It says that the central maven repo
is a release repository.  But then in the example for how to configure
a profile that will use the nexus served repository instead of
central, it shows configuring the central repo to lookup both
snapshots and releases.

This is a bit confusing . . . can someone elaborate.  First, is it
true that central repo only serves releases?  Second, what's going on
with the example configuration that turns on both releases and
snapshots for the central repo?

Thanks!

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


Re: central repo, snapshots and releases

Posted by ChadDavis <ch...@gmail.com>.
On Mon, Aug 23, 2010 at 3:24 PM, Brian Fox <br...@infinity.nu> wrote:
> The reason is simple:

Simple, but not obvious ;)

>
> 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)

I was kind of guessing that.  So, Maven, by default has the actual
Maven Central Repo defined under the id "central" . . . I didn't quite
realize that before.

> 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 ;-)
>

So, in a nutshell, you've redefined the repo with id of central to
point somewhere else, the bogus URL, and then mirrored it with the
wildcard.


> 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.

Makes perfect sense.  Thanks for the explanation.

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


Re: central repo, snapshots and releases

Posted by Brian Fox <br...@infinity.nu>.
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 <ch...@gmail.com> 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: 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: central repo, snapshots and releases

Posted by ChadDavis <ch...@gmail.com>.
> <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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: central repo, snapshots and releases

Posted by Ron Wheeler <rw...@artifact-software.com>.
  On 23/08/2010 1:15 PM, Wendy Smoak wrote:
> On Mon, Aug 23, 2010 at 1:09 PM, Ron Wheeler
> <rw...@artifact-software.com>  wrote:
>> So the client needs to configure 2 repositories- one for all the releases
>> and one for all the SNAPSHOTS.
> You should be able to use a single repo url from the client -- the
> repo managers have the concept of a 'virtual repository' or a
> 'repository group'.
>

Wendy is right.

Here is my slightly modified    .settings.xml
to give a concrete example of a working configuration.

A lot of the configuration and brains on on the Nexus side.
It knows how to deploy a SNAPSHOT that gets sent its way regardless of 
what I call it on the client side.


<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                       http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>nexus</id>
<username>me_me_me</username>
<password>secret</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>me_me_me</username>
<password>secret</password>
</server>
</servers>

<localRepository>c:\maven_repository/</localRepository>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://repo.xxx.ccc:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<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>


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


Re: central repo, snapshots and releases

Posted by Wendy Smoak <ws...@gmail.com>.
On Mon, Aug 23, 2010 at 1:09 PM, Ron Wheeler
<rw...@artifact-software.com> wrote:
> So the client needs to configure 2 repositories- one for all the releases
> and one for all the SNAPSHOTS.

You should be able to use a single repo url from the client -- the
repo managers have the concept of a 'virtual repository' or a
'repository group'.

-- 
Wendy

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


Re: central repo, snapshots and releases

Posted by Ron Wheeler <rw...@artifact-software.com>.
  Your nexus is a proxy for releases from central
Your Nexus has a place to host third party libraries that can not be 
distributed from Central due to licensing issues.
Your Nexus is a host for your releases
Your Nexus is a host for your SNAPSHOTs
When deploying you only deploy to the last 2

When getting releases, you want to set up Nexus to give you both your 
own stuff and the other sites that it hosts or proxies
When getting SNAPSHOTS you usually want your own snapshots
When deploying the client needs to tell the IDE where the releases go 
and where the SNAPSHOTS go.

So the client needs to configure 2 repositories- one for all the 
releases and one for all the SNAPSHOTS.

Nexus will respond to your requests for whichever sort of artifact that 
you want but it does need to keep separate lists of configured places on 
its side to keep things straight so the client needs 2 places to get 
things and to deploy things.


Ron


On 23/08/2010 12:45 PM, ChadDavis wrote:
> I'm reading the Nexus book.  It describes how a given repository is
> either for releases or snapshots.  It says that the central maven repo
> is a release repository.  But then in the example for how to configure
> a profile that will use the nexus served repository instead of
> central, it shows configuring the central repo to lookup both
> snapshots and releases.
>
> This is a bit confusing . . . can someone elaborate.  First, is it
> true that central repo only serves releases?  Second, what's going on
> with the example configuration that turns on both releases and
> snapshots for the central repo?
>
> 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