You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@archiva.apache.org by Dennis Lundberg <de...@apache.org> on 2008/06/02 16:46:45 UTC

Re: Choosing which repositories you install to

EJ Ciramella wrote:
> After 24 hours I've had a chance to regroup my thoughts (Dennis L's line
> of questioning parallels some of mine as well).
> 
> We have the following goals:
> 
> 1 - Move our poorly managed "bertha" repository to be a retired (but
> still available for downloads) repository.

We will probably shut down our old repo completely once the new one is 
populated and all developers have configured Maven properly, see more on 
that below. Is there a reason why you want to keep bertha alive?

> 2 - Proxy all other repositories (and set up at least one additional
> mirror for each).
> 3 - Create new managed repositories for our projects (one snapshot and
> one "release" repository for each).
> 4 - Reduce the amount of configuration managed by maven 2 consumers.
> 
> Ideally, if people had an entry in settings.xml for a repository, it'd
> be a single entry pointing to archiva (is this even possible?).  In the
> various projects, via <distributionManagement>, we'd configure the two
> repositories for the projects (snapshot/release).  We only have (and
> likely will only ever have) two real projects so there will only be four
> active internally managed repositories.

We ended up with this in each developer's settings.xml:

<settings>
   <servers>
     <server>
       <id>internal</id>
       <username>myUserId</username>
       <password>secretPassword</password>
     </server>
     <server>
       <id>snapshots</id>
       <username>myUserId</username>
       <password>secretPassword</password>
     </server>
   </servers>

   <profiles>
     <profile>
       <id>Repository Proxy</id>
       <activation>
         <activeByDefault>true</activeByDefault>
       </activation>
       <repositories>
         <repository>
           <id>internal</id>
           <name>Archiva Managed Internal Repository</name>
           <url>http://repo.company.com/archiva/repository/internal/</url>
           <releases>
             <enabled>true</enabled>
           </releases>
           <snapshots>
             <enabled>false</enabled>
           </snapshots>
         </repository>
         <repository>
           <id>snapshots</id>
           <name>Archiva Managed Snapshot Repository</name>
           <url>http://repo.company.com/archiva/repository/snapshots/</url>
           <releases>
             <enabled>false</enabled>
           </releases>
           <snapshots>
             <enabled>true</enabled>
           </snapshots>
         </repository>
       </repositories>
     </profile>
   </profiles>
</settings>

The servers section authenticates the user to the repos.

The profiles section gives the developer access to the repo so that they 
can download from it. This includes getting hold of the company parent 
POM which can otherwise be a chicken-and-egg problem.

This is combined with the following snippet in the company parent POM:

<project>
   ...
   <distributionManagement>
     <repository>
       <id>internal</id>
       <url>dav:http://repo.company.com/archiva/repository/internal/</url>
     </repository>
     <snapshotRepository>
       <id>snapshots</id>
       <url>dav:http://repo.company.com/archiva/repository/snapshots/</url>
     </snapshotRepository>
   </distributionManagement>
</project>

Notice that we use the same id:s (internal and snapshots) when we 
declare the repos in settings.xml and when we declare the 
distributionManagement. This allows us to configure the authentication 
for download/upload to the repo one time in the servers section of 
settings.xml.

> Is this even possible?  Will we have to roll our own maven 2
> installation (utilizing the conf/settings.xml to load repositories)?

This setup doesn't touch your Maven installation at all.

> Thanks again Wendy for putting up with my questioning, I'm really hoping
> Archiva will be the silver bullet I'm looking for.
> 
> -----Original Message-----
> From: Wendy Smoak [mailto:wsmoak@gmail.com] 
> Sent: Thursday, May 29, 2008 3:43 PM
> To: users@archiva.apache.org
> Subject: Re: Choosing which repositories you install to
> 
> On Thu, May 29, 2008 at 12:36 PM, EJ Ciramella
> <ej...@upromise.com> wrote:
> 
>> So apparently, what's blocking is the lack of a user/pass combo.
>>
>> I have the guest account enabled, do I have to go through and add all
>> the server configuration (where I can supply this)?
> 
> For deployment?  Server credentials go in settings.xml, see
> http://maven.apache.org/ref/2.0.8/maven-settings/settings.html.  Make
> sure the server id in settings.xml matches the repository id in
> distributionManagemnt.
> 
> If you just want to test it you could give the guest account
> 'repository manager' permission.
> 
> If you're not using Maven 2.0.9, you'll need wagon-webdav as a build
> extension, and the url looks like:
> dav:http://myserver.com/archiva/repository/internal .
> 


-- 
Dennis Lundberg