Managed repositories and Maven local repository

View: New views
9 Messages — Rating Filter:   Alert me  

Managed repositories and Maven local repository

by teacup :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello, all:

I have been using Arhiva happily for over a year.  I have Archiva and Contiuum both running on the same server.  But while I configured an internal repo (under Tomcat installation - /opt/apache-tomcat-6.0.14/data/respositories/internal) and a snapshots directory (also under Tomcat installation - /opt/apache-tomcat-6.0.14/data/repositories/snapshots), Continuum has its own default local repository (/home/specialuser/.m2/repository.

Note that the user 'specialuser' owns Tomcat, Archiva, and Continuum installations.  Anyway, so my problem is that Archiva downloads and maintains same artifacts under its own repos (under Tomcat - see above) that Continuum maintains under its default local repository (see above) - and this means unnecessary duplication to me.  I mean all those huge artifact jars are present in two places on my server.

Contiuum does not allow me (as an admin user) to change the default repo, but Archiva does allow me to specify managed repos.  Can I update Archiva's existing managed repos (both internal and snapshots) to point to /home/specialuser/.m2/repository?  Because Maven does not allow any directory names under /home/user/.m2/repository, I cannot create 'internal' and 'snapshots' directories there and so I will have to specify the same Maven directory for 'internal' and 'snapshots' on Archiva's Admin GUI for managed repos.  Will that work?

Now another issue: even if I get the above setup working (and I guess it would work just fine), now both Archiva and Continuum would be managing the same repo (purging it, etc).  Will that be a problem?

In other words how do I eliminate the whole duplication issue?  Or is it normal to have duplicate copies of artifacts on the same server, one each for Archiva and Continuum?  Thanks.

Re: Managed repositories and Maven local repository

by brettporter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On 17/12/2008, at 12:21 AM, teacup wrote:

> Note that the user 'specialuser' owns Tomcat, Archiva, and Continuum
> installations.  Anyway, so my problem is that Archiva downloads and
> maintains same artifacts under its own repos (under Tomcat - see  
> above) that
> Continuum maintains under its default local repository (see above) -  
> and
> this means unnecessary duplication to me.  I mean all those huge  
> artifact
> jars are present in two places on my server.

This would be likely to cause conflicts for the Maven process as it  
executes, and the format of the local and remote repositories are  
different.

While it's not ideal, you are best to utilise the purge features of  
both Continuum and Archiva to keep the local and snapshot repos trim  
so that duplication is at a minimum.

Hopefully future versions of Maven will better support this within the  
local repository (I have a proposal prepared for this already).

Cheers,
Brett

--
Brett Porter
brett@...
http://blogs.exist.com/bporter/


Re: Managed repositories and Maven local repository

by teacup :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Brett.  I finally decided not to mix up Archiva setup with Continuum's.  As you suggested, I will keep purging the stuff in both manually.  I cannot wait to see a better support for this in Maven.

brettporter wrote:

On 17/12/2008, at 12:21 AM, teacup wrote:

> Note that the user 'specialuser' owns Tomcat, Archiva, and Continuum
> installations.  Anyway, so my problem is that Archiva downloads and
> maintains same artifacts under its own repos (under Tomcat - see  
> above) that
> Continuum maintains under its default local repository (see above) -  
> and
> this means unnecessary duplication to me.  I mean all those huge  
> artifact
> jars are present in two places on my server.

This would be likely to cause conflicts for the Maven process as it  
executes, and the format of the local and remote repositories are  
different.

While it's not ideal, you are best to utilise the purge features of  
both Continuum and Archiva to keep the local and snapshot repos trim  
so that duplication is at a minimum.

Hopefully future versions of Maven will better support this within the  
local repository (I have a proposal prepared for this already).

Cheers,
Brett

--
Brett Porter
brett@apache.org
http://blogs.exist.com/bporter/

Re: Managed repositories and Maven local repository

by jamiebarrow :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm not sure if Continuum manages its own repository, or just uses the default Maven local repository (~/.m2/repository). I think this may be the case.

Did you manage to find a way of using the default Maven local maven repository with Archiva?

That is, I have an already existing Maven repository on my drive. I now install Archiva, and want to import/use that existing Maven repository. Is it possible?

Cheers,

James

teacup wrote:
Contiuum does not allow me (as an admin user) to change the default repo, but Archiva does allow me to specify managed repos.  Can I update Archiva's existing managed repos (both internal and snapshots) to point to /home/specialuser/.m2/repository?

Re: Managed repositories and Maven local repository

by Wendy Smoak-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, May 25, 2009 at 8:08 AM, jamiebarrow <jamiebarrow@...> wrote:

> I'm not sure if Continuum manages its own repository, or just uses the
> default Maven local repository (~/.m2/repository). I think this may be the
> case.
>
> Did you manage to find a way of using the default Maven local maven
> repository with Archiva?

Archiva is meant to manage *remote* repositories, not local ones.

> That is, I have an already existing Maven repository on my drive. I now
> install Archiva, and want to import/use that existing Maven repository. Is
> it possible?

In general you can't interchange local and remote repos because the
metadata is different.  However Archiva is supposed to repair broken
metadata, so you can try making a copy of your local repo and pointing
Archiva at it as a managed repo.

--
Wendy

Re: Managed repositories and Maven local repository

by James Barrow-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Quoting Wendy Smoak <wsmoak@...>:

>
> In general you can't interchange local and remote repos because the
> metadata is different.  However Archiva is supposed to repair broken
> metadata, so you can try making a copy of your local repo and pointing
> Archiva at it as a managed repo.

Thanks for the reply Wendy, I did try that, but it unfortunately  
doesn't work. Due to bandwidth constraints, I really wouldn't want to  
re-download everything from the central repo, also, because there's so  
many artifacts, manually uploading everything to Archiva would take so  
long.

Hopefully they add this functionality.

Cheers,

James


Re: Managed repositories and Maven local repository

by Wendy Smoak-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, May 26, 2009 at 12:17 AM, James Barrow
<james.barrow@...> wrote:

> Thanks for the reply Wendy, I did try that, but it unfortunately doesn't
> work. Due to bandwidth constraints, I really wouldn't want to re-download
> everything from the central repo, also, because there's so many artifacts,
> manually uploading everything to Archiva would take so long.
>
> Hopefully they add this functionality.

I'm pretty sure someone has written a script to convert a local repo
into a remote one-- check the Maven users list archives.

--
Wendy

Re: Managed repositories and Maven local repository

by brettporter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I believe Archiva will handle a local repository directly since it  
uses the same format for tracking remote metadata file downloads,  
which is the main difference. If you have artifacts in the local  
repository that were generated with 'mvn install' you may get into  
trouble - removing versions that are -SNAPSHOT (not timestamped) and  
their associated metadata files (which will contain  
<useLocalCopy>true</>) will cover these.

- Brett

On 27/05/2009, at 4:56 AM, Wendy Smoak wrote:

> On Tue, May 26, 2009 at 12:17 AM, James Barrow
> <james.barrow@...> wrote:
>
>> Thanks for the reply Wendy, I did try that, but it unfortunately  
>> doesn't
>> work. Due to bandwidth constraints, I really wouldn't want to re-
>> download
>> everything from the central repo, also, because there's so many  
>> artifacts,
>> manually uploading everything to Archiva would take so long.
>>
>> Hopefully they add this functionality.
>
> I'm pretty sure someone has written a script to convert a local repo
> into a remote one-- check the Maven users list archives.
>
> --
> Wendy


Re: Managed repositories and Maven local repository

by teacup :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

No, I did not find any way of using the default Maven local repository through Archiva.  I am still bothered about having two copies of same huge jars in different directories on my server.  If I find any solution to this issue on Maven forum, I will post it here.


Hi,

I'm not sure if Continuum manages its own repository, or just uses the default Maven local repository (~/.m2/repository). I think this may be the case.

Did you manage to find a way of using the default Maven local maven repository with Archiva?

That is, I have an already existing Maven repository on my drive. I now install Archiva, and want to import/use that existing Maven repository. Is it possible?

Cheers,

James

teacup wrote:
Contiuum does not allow me (as an admin user) to change the default repo, but Archiva does allow me to specify managed repos.  Can I update Archiva's existing managed repos (both internal and snapshots) to point to /home/specialuser/.m2/repository?