You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@archiva.apache.org by Aa...@Globus.ch on 2006/12/04 11:19:00 UTC

Proxy settings

Hello,

We're using maven for internal development. Since the internet as a whole 
and our connection to it especially are not always reliable (for example, 
a new version of a virus checker sometimes starts to block out maven 
downloads), we wanted to use Archiva as a local cache of the central maven 
repositories.

As it is right now, I have to configure each repository individually. What 
we would prefer is a setting which makes Archiva the default proxy for 
maven so all external connections are made over it.

This would allow us to keep local copies of all artefacts so internet 
outages wouldn't affect us anymore. Also, we could fix broken packages 
locally. Ideally, there should be two caches: One with stable version for 
development and one which can update itself with the current versions from 
the internet.

Is this possible?

Regards,

-- 
Aaron Digulla


RE: Proxy settings

Posted by Aa...@Globus.ch.
> You can use * as mirror id to mactch all servers since maven 2.0.5
> (not yet released) or Maestro 1.1 that you can get from
> http://www.mergere.com/

1. How can I get maven 2.0.5? Or maven 2.1? Should I checkout from 
Subversion or is there a download?

2. Which proxy supports this? In Archiva, I have to specify exactly which 
URL should be mirrored (additionally to the mirrors in settings.xml). Does 
it work with Proxmitiy? Or maven-proxy?

Regards,

-- 
Aaron Digulla


Re: Antwort: RE: Antwort: RE: Proxy settings

Posted by Carlos Sanchez <ca...@apache.org>.
On 12/4/06, Mohni, Daniel <da...@ch.unisys.com> wrote:
>
> > -----Original Message-----
> > From: Aaron.Digulla@Globus.ch [mailto:Aaron.Digulla@Globus.ch]
>
> > My position is that the POMs which come from the main sites
> > can (and will)
> > contain anything (even illegal XML, broken checksums, etc).
> > The proxy has
> > to handle all these case gracefully or at least to support
> > the admin in
> > doing so.
> >
> > I'm missing these functions in archiva:
> >
> > - Generic proxy (so the POMs can't mess with your mirror settings).
>
> from my point of view this has nothing to do with archiva, this is a
> maven problem.
> I don't know if you can setup a generic proxy in your settings.xml as I
> didn't
> find anyhing in the documentation, but maybe there is a hidden option
> ;-)
>
> checkout http://maven.apache.org/settings.html


You can use * as mirror id to mactch all servers since maven 2.0.5
(not yet released) or Maestro 1.1 that you can get from
http://www.mergere.com/


>
>
> > - Regenerate checksum (for all downloads which I needed to fix)
>
> As far as I know this is one of the features that will be implemented
> into archiva,
> maybe it's already in the daily builds but I didn't tested them the last
> few days...
>
> > - Lock down file (so Archiva will not try to download it
> > again even if the
> > remote site says "but I have new version" or the user says "get the
> > newest, hottest snapshots!").
>
> this can be done be done on user site with the usePluginRegistry
> property set to true,
> but this is not realy nice as you will have to confirm every plugin
> version...
>
> loking files in the proxy is only usefull if this is used for all users,
> is this
> realy what you want ?
> What will you do if another team use another version....
>
> >
> > I can live without the last two but the first one is a must, IMHO.
>
> -> fill an issue on the maven project, maybe it's already in jira...
>
> just my two cents
>
> Daniel
>


-- 
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                             -- The Princess Bride

RE: 504 in maven, works everywhere else

Posted by Aa...@Globus.ch.
Hello all,

I've now solved the problem by writing my own proxy. It's called DSMP 
(Dead Stu..Simple Maven Proxy) and can be used with the <proxy> setting in 
settings.xml.

It has these features:

- It automatically mirrors any Maven repository, not only those mentioned 
in some config/POM/whatever file.
- It remembers error returns from respository servers, so update checks 
run really fast. In the next version, I'm thinking about pluggable status 
caching strategies.
- You can redirect requests from one URL to another. So, for example, if 
Maven believes that the maven-compiler-plugin has to be downloaded from 
http://mysterious.com/, you can rewrite that URL in the proxy without 
having to touch either your local repository or the broken POM. Of you can 
direct all maven requests to your nearest proxy without having to change 
the maven configuration. This will even work if there are multiple URLs to 
access the same file on a server (for example, on maven.sateh.com, 
"maven2" is a link to "repository").
- It allows to merge patches into the downloads. This way, you can add 
your own fixes to broken artefacts without changing maven, without having 
to enable SNAPSHOTs and without having to worry that all your developers 
use the same proxy/mirror/repository settings.

Things I'm thinking about:

- Forbid downloads (always return 404 for some site)
- Lock down snapshots (always return "no, there is no newer version")
- Version migration. There should be a simple way to create a 
self-contained set of files which allow a new plugin/artefact version to 
run/compile. The idea is that one developer examines a new version, checks 
that it doesn't break the build, etc. and then tells the proxy "Ok, now I 
want everyone to be able to see the new version" or "Nah, drop it".

I was thinking if you might want to include this in Archiva. The proxy 
runs independent of any container, though. Since it can create an 
arbitrary amount of threads, starting it from tomcat or jetty might not be 
that smart.

-- 
Aaron Digulla

RE: Antwort: RE: 504 in maven, works everywhere else

Posted by "Mohni, Daniel" <da...@ch.unisys.com>.
> -----Original Message-----
> From: Aaron.Digulla@Globus.ch [mailto:Aaron.Digulla@Globus.ch] 
> Sent: Wednesday, December 06, 2006 11:43 AM
> To: archiva-users@maven.apache.org
> Subject: Antwort: RE: 504 in maven, works everywhere else
> 
> > Hello Aaron
> > 
> > you need to provide some information about what is in your
> > settings.xml....
> 
> I have a couple of repositories. The relevant entry is:
> 
>         <repository>
>           <id>snapshot</id>
>           <name>Snapshots and patched packages</name>
>           <url>http://m2proxy:8080/archiva/repository/snapshot</url>
>           <releases><enabled>false</enabled></releases>
>           <snapshots><enabled>true</enabled></snapshots>
>         </repository>
> 

every thing is fine for normal artefacts, but for plugins you have to
also configure the <pluginRepository>, I think you have something
like this...

<pluginRepository>
   <id>plugin.snapshot</id>
    <name>Snapshots and patched packages</name>
    <url>http://m2proxy:8080/archiva/repository/snapshot</url>
    <releases><enabled>false</enabled></releases>
    <snapshots>
	<enabled>true</enabled>
      <updatePolicy>never</updatePolicy>
    </snapshots>
</pluginRepository>

as maven is looking at your server
you can add <updatePolicy>never</updatePolicy>

    <snapshots>
	<enabled>true</enabled>
      <updatePolicy>never</updatePolicy>
    </snapshots>

to get rid of this checking, I think... 

> And I have this mirror:
> 
>         <mirror>
>             <id>central</id>
>             <mirrorOf>central</mirrorOf>
>             <name>Central repository mirror</name>
>             <url>http://maven.sateh.com/maven2</url>
>         </mirror>
 
in my case I use my archiva server as mirror and let archiva do the
checking on proxied repositories...

<mirror>
    <id>central.mirror</id>
    <mirrorOf>central</mirrorOf>
    <name>Central repository mirror</name>
    <url>http://m2proxy:8080/archiva/proxy/....</url>
</mirror>


this still does not realy help, with the failing download...
sorry

Daniel



> When I download directly, I don't need a password; I've 
> configure "guest" 
> in archiva as "observer for repo snapshot".
> 
> Regards,
> 
> -- 
> Aaron Digulla
> 
> "Mohni, Daniel" <da...@ch.unisys.com> schrieb am 05.12.2006 
> 11:33:34:
> 
> > Hello Aaron
> > 
> > you need to provide some information about what is in your
> > settings.xml....
> > 
> > sometimes it also helps to use mvn -U ... 
> > to update the dependencies
> > 
> > regards
> > 
> > Daniel 
> > 
> > > -----Original Message-----
> > > From: Aaron.Digulla@Globus.ch [mailto:Aaron.Digulla@Globus.ch] 
> > > Sent: Tuesday, December 05, 2006 11:19 AM
> > > To: archiva-users@maven.apache.org
> > > Subject: 504 in maven, works everywhere else
> > > 
> > > Hello,
> > > 
> > > All of a sudden, archiva doesn't like maven anymore (or 
> the other way 
> > > 'round):
> > > 
> > > Caused by: java.io.IOException: Server returned HTTP response 
> > > code: 504 
> > > for URL:
> > > 
> > > 
> http://m2proxy:8080/archiva/repository/snapshot/org/apache/maven/plugi
> > > ns/maven-deploy-plugin/2.3-SNAPSHOT/maven-metadata.xml
> > >         at 
> > > 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
> > > nection.java:1153)
> > >         at 
> > > 
> org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputD
> > > ata(LightweightHttpWagon.java:85)
> > > 
> > > When I download the very same file in a browser or with wget, 
> > > it works!
> > > 
> > > Maven together with Archiva is starting to drive me nuts! 
> Sometimes, 
> > > something works, sometimes, it doesn't.
> > > 
> > > I have three repositories with releases and maven says "oh, I 
> > > checked all 
> > > of them" but when I run maven with -X, I see it just checks 
> > > the snapshot 
> > > repository!
> > > 
> > > The *snapshot* repository! For a RELEASE!
> > > 
> > > What's wrong with this crap :-((((
> > > 
> > > Regards,
> > > 
> > > -- 
> > > Aaron Digulla
> > > 
> > > 
> 
> 

Antwort: RE: 504 in maven, works everywhere else

Posted by Aa...@Globus.ch.
> Hello Aaron
> 
> you need to provide some information about what is in your
> settings.xml....

I have a couple of repositories. The relevant entry is:

        <repository>
          <id>snapshot</id>
          <name>Snapshots and patched packages</name>
          <url>http://m2proxy:8080/archiva/repository/snapshot</url>
          <releases><enabled>false</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>

And I have this mirror:

        <mirror>
            <id>central</id>
            <mirrorOf>central</mirrorOf>
            <name>Central repository mirror</name>
            <url>http://maven.sateh.com/maven2</url>
        </mirror>

When I download directly, I don't need a password; I've configure "guest" 
in archiva as "observer for repo snapshot".

Regards,

-- 
Aaron Digulla

"Mohni, Daniel" <da...@ch.unisys.com> schrieb am 05.12.2006 
11:33:34:

> Hello Aaron
> 
> you need to provide some information about what is in your
> settings.xml....
> 
> sometimes it also helps to use mvn -U ... 
> to update the dependencies
> 
> regards
> 
> Daniel 
> 
> > -----Original Message-----
> > From: Aaron.Digulla@Globus.ch [mailto:Aaron.Digulla@Globus.ch] 
> > Sent: Tuesday, December 05, 2006 11:19 AM
> > To: archiva-users@maven.apache.org
> > Subject: 504 in maven, works everywhere else
> > 
> > Hello,
> > 
> > All of a sudden, archiva doesn't like maven anymore (or the other way 
> > 'round):
> > 
> > Caused by: java.io.IOException: Server returned HTTP response 
> > code: 504 
> > for URL:
> > 
> > http://m2proxy:8080/archiva/repository/snapshot/org/apache/maven/plugi
> > ns/maven-deploy-plugin/2.3-SNAPSHOT/maven-metadata.xml
> >         at 
> > sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
> > nection.java:1153)
> >         at 
> > org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputD
> > ata(LightweightHttpWagon.java:85)
> > 
> > When I download the very same file in a browser or with wget, 
> > it works!
> > 
> > Maven together with Archiva is starting to drive me nuts! Sometimes, 
> > something works, sometimes, it doesn't.
> > 
> > I have three repositories with releases and maven says "oh, I 
> > checked all 
> > of them" but when I run maven with -X, I see it just checks 
> > the snapshot 
> > repository!
> > 
> > The *snapshot* repository! For a RELEASE!
> > 
> > What's wrong with this crap :-((((
> > 
> > Regards,
> > 
> > -- 
> > Aaron Digulla
> > 
> > 


RE: 504 in maven, works everywhere else

Posted by "Mohni, Daniel" <da...@ch.unisys.com>.
Hello Aaron

you need to provide some information about what is in your
settings.xml....

sometimes it also helps to use mvn -U ... 
to update the dependencies

regards

Daniel 

> -----Original Message-----
> From: Aaron.Digulla@Globus.ch [mailto:Aaron.Digulla@Globus.ch] 
> Sent: Tuesday, December 05, 2006 11:19 AM
> To: archiva-users@maven.apache.org
> Subject: 504 in maven, works everywhere else
> 
> Hello,
> 
> All of a sudden, archiva doesn't like maven anymore (or the other way 
> 'round):
> 
> Caused by: java.io.IOException: Server returned HTTP response 
> code: 504 
> for URL:
>  
> http://m2proxy:8080/archiva/repository/snapshot/org/apache/maven/plugi
> ns/maven-deploy-plugin/2.3-SNAPSHOT/maven-metadata.xml
>         at 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
> nection.java:1153)
>         at 
> org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputD
> ata(LightweightHttpWagon.java:85)
> 
> When I download the very same file in a browser or with wget, 
> it works!
> 
> Maven together with Archiva is starting to drive me nuts! Sometimes, 
> something works, sometimes, it doesn't.
> 
> I have three repositories with releases and maven says "oh, I 
> checked all 
> of them" but when I run maven with -X, I see it just checks 
> the snapshot 
> repository!
> 
> The *snapshot* repository! For a RELEASE!
> 
> What's wrong with this crap :-((((
> 
> Regards,
> 
> -- 
> Aaron Digulla
> 
> 

504 in maven, works everywhere else

Posted by Aa...@Globus.ch.
Hello,

All of a sudden, archiva doesn't like maven anymore (or the other way 
'round):

Caused by: java.io.IOException: Server returned HTTP response code: 504 
for URL:
 http://m2proxy:8080/archiva/repository/snapshot/org/apache/maven/plugi
ns/maven-deploy-plugin/2.3-SNAPSHOT/maven-metadata.xml
        at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:1153)
        at 
org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputD
ata(LightweightHttpWagon.java:85)

When I download the very same file in a browser or with wget, it works!

Maven together with Archiva is starting to drive me nuts! Sometimes, 
something works, sometimes, it doesn't.

I have three repositories with releases and maven says "oh, I checked all 
of them" but when I run maven with -X, I see it just checks the snapshot 
repository!

The *snapshot* repository! For a RELEASE!

What's wrong with this crap :-((((

Regards,

-- 
Aaron Digulla


RE: Proxy settings

Posted by "Mohni, Daniel" <da...@ch.unisys.com>.
 

> -----Original Message-----
> From: Aaron.Digulla@Globus.ch [mailto:Aaron.Digulla@Globus.ch] 
> Sent: Tuesday, December 05, 2006 9:43 AM
> To: archiva-users@maven.apache.org
> Subject: Antwort: RE: Antwort: RE: Antwort: RE: Proxy settings
> 
> "Mohni, Daniel" <da...@ch.unisys.com> schrieb am 05.12.2006 
> 07:28:36:
> 
> > > - Generic proxy (so the POMs can't mess with your mirror 
> settings).
> > 
> > from my point of view this has nothing to do with archiva, this is a
> > maven problem.
> > I don't know if you can setup a generic proxy in your 
> settings.xml as I
> > didn't
> > find anyhing in the documentation, but maybe there is a 
> hidden option
> > ;-) 
> > 
> > checkout http://maven.apache.org/settings.html 
> 
> The setting is called "<proxy>". This allows to inject a proxy server 
> which could filter all HTTP requests sent out by maven.

never tried this one :-( , 
do you get any artefacts from archiva using only the proxy setup ?

there was a problem with the proxy servlet, as soon as you have more
than one
proxied repo's the access without 'repo-id' didn't work, maybe this is
fixed now

I don't think that the proxy servlet is implemented the way you want to
use it,
but I may be wrong...

check 
	org.apache.maven.archiva.proxy.DefaultProxyManager 
	org.apache.maven.archiva.proxy.DefaultProxyRequestHandler 

maybe you can provide a patch....

Regards

Daniel

Antwort: RE: Antwort: RE: Antwort: RE: Proxy settings

Posted by Aa...@Globus.ch.
"Mohni, Daniel" <da...@ch.unisys.com> schrieb am 05.12.2006 
07:28:36:

> > - Generic proxy (so the POMs can't mess with your mirror settings).
> 
> from my point of view this has nothing to do with archiva, this is a
> maven problem.
> I don't know if you can setup a generic proxy in your settings.xml as I
> didn't
> find anyhing in the documentation, but maybe there is a hidden option
> ;-) 
> 
> checkout http://maven.apache.org/settings.html 

The setting is called "<proxy>". This allows to inject a proxy server 
which could filter all HTTP requests sent out by maven.

Regards,

-- 
Aaron Digulla


RE: Antwort: RE: Antwort: RE: Proxy settings

Posted by "Mohni, Daniel" <da...@ch.unisys.com>.
> -----Original Message-----
> From: Aaron.Digulla@Globus.ch [mailto:Aaron.Digulla@Globus.ch] 

> My position is that the POMs which come from the main sites 
> can (and will) 
> contain anything (even illegal XML, broken checksums, etc). 
> The proxy has 
> to handle all these case gracefully or at least to support 
> the admin in 
> doing so.
> 
> I'm missing these functions in archiva:
> 
> - Generic proxy (so the POMs can't mess with your mirror settings).

from my point of view this has nothing to do with archiva, this is a
maven problem.
I don't know if you can setup a generic proxy in your settings.xml as I
didn't
find anyhing in the documentation, but maybe there is a hidden option
;-) 

checkout http://maven.apache.org/settings.html 


> - Regenerate checksum (for all downloads which I needed to fix)

As far as I know this is one of the features that will be implemented
into archiva,
maybe it's already in the daily builds but I didn't tested them the last
few days...

> - Lock down file (so Archiva will not try to download it 
> again even if the 
> remote site says "but I have new version" or the user says "get the 
> newest, hottest snapshots!").

this can be done be done on user site with the usePluginRegistry
property set to true,
but this is not realy nice as you will have to confirm every plugin
version...

loking files in the proxy is only usefull if this is used for all users,
is this
realy what you want ? 
What will you do if another team use another version.... 

> 
> I can live without the last two but the first one is a must, IMHO.

-> fill an issue on the maven project, maybe it's already in jira...

just my two cents

Daniel

Antwort: RE: Antwort: RE: Proxy settings

Posted by Aa...@Globus.ch.
"Mohni, Daniel" <da...@ch.unisys.com> schrieb am 04.12.2006 
15:15:13:

> A released plugin should not have a repository entry in his pom.xml !!!
> that's my opinion, but maybe it's wrong... 

My position is that the POMs which come from the main sites can (and will) 
contain anything (even illegal XML, broken checksums, etc). The proxy has 
to handle all these case gracefully or at least to support the admin in 
doing so.

I'm missing these functions in archiva:

- Generic proxy (so the POMs can't mess with your mirror settings).
- Regenerate checksum (for all downloads which I needed to fix)
- Lock down file (so Archiva will not try to download it again even if the 
remote site says "but I have new version" or the user says "get the 
newest, hottest snapshots!").

I can live without the last two but the first one is a must, IMHO.

Regards,

-- 
Aaron Digulla


RE: Antwort: RE: Proxy settings

Posted by "Mohni, Daniel" <da...@ch.unisys.com>.
Hello again

all I can say about this is that a lot of the current maven2 plugins
are still in development and not in release state. this is
also why they have this snapshot repositories in their pom...

but they are going to be stable quite soon, hopefully...

using snapshot dependency that you can not control is a mess, in 
a customer project.

If you realy need a snapshot version for your project, then the
workaround is to build the plugin from source with your custom
artifactId and deploy it to your repository. it's not very nice
but in this case you have control over the used version in your project
until the plugin is stable.

A released plugin should not have a repository entry in his pom.xml !!!
that's my opinion, but maybe it's wrong... 

Maybe someone else can help you out

sorry

Daniel
 

> -----Original Message-----
> From: Aaron.Digulla@Globus.ch [mailto:Aaron.Digulla@Globus.ch] 
> Sent: Monday, December 04, 2006 2:51 PM
> To: archiva-users@maven.apache.org
> Subject: Antwort: RE: Proxy settings
> 
> Hi Daniel,
> 
> What do I do if POM.xml of a plugin says this:
> 
> <repositories>
>     <repository>
>         <id>apache-snapshots</id>
>         <name>Snapshot repository</name>
>         <url>http://people.apache.org/maven-snapshot-repository/</url>
>     </repository>
> </repositories>
> 
> but the plugin cannot be found in this repository? Like in the JSP 
> compiler maven plugin from codehaus.
> 
> My problem is the <id>. Every project defines their own id. 
> For some, it's 
> "codehaus", for others it's "codehaus.org". For another 
> group, "codehaus" 
> is for releases, while "codehaus.org" is for snapshots.
> 
> This means the id *cannot* be used to map mirrors to URLs.
> 
> Therefore, I need a solution in archiva which I can feed with 
> arbitrary 
> URLs and which either goes to a stable inhouse repository or 
> downloads the 
> resource from the URL and caches it.
> 
> Having users define proxied repositories manually and map 
> them to managed 
> repositories is not the solution, it's another layer of 
> problems. Archia 
> should support a generic proxy/cache which just stores a 
> resource under an 
> URL. So when I ask for apache.org/.../plugin-1.3.pom and for 
> codehaus.org/.../plugin-1.3.pom, I should get two different 
> files if they 
> are different on the respective servers.
> 
> On disk, you can just use the hostname as the first item in 
> the path to 
> distinguish between the different artefacts.
> 
> In the webapp, it should be possible to "freeze" certain URLs (for 
> example, if the files on the web are broken or I'm using a 
> patched version 
> inhouse).
> 
> With this solution, I could use the Maven proxy settings 
> (instead of the 
> broken mirror stuff) to download artefacts for my development 
> team *once*.
> 
> Regards,
> 
> -- 
> Aaron Digulla
> 
> "Mohni, Daniel" <da...@ch.unisys.com> schrieb am 04.12.2006 
> 11:31:28:
> 
> > Hello Aaron
> > 
> > this can be done setting the mirror in settings.xml
> > 
> >  <mirrors>
> >    <mirror>
> >      <id>proxy.central</id>
> >    <mirrorOf>central</mirrorOf>
> >         <name>Internal Mirror of central.</name>
> >    <url>http://archiva/proxy/maven_release</url>
> >     </mirror>
> >   </mirrors>
> > 
> > -> if you use proxy in the url then archiva will try to download
> >    missing artefacts from the proxied repo setup in archiva
> > 
> >    http://archiva/proxy/maven_release
> > 
> > -> if you use repository in the url then archiva will only be
> >    a cache provider for your already downloaded artefacts
> > 
> >    http://archiva/repository/maven_release
> > 
> > maven_release is our internal proxy repository...
> > 
> > I don't know if this is still like this in the current daily build
> > as I didn't tried it...
> > 
> > hth
> > 
> > Daniel
> > 
> > > -----Original Message-----
> > > From: Aaron.Digulla@Globus.ch [mailto:Aaron.Digulla@Globus.ch] 
> > > Sent: Monday, December 04, 2006 11:19 AM
> > > To: archiva-users@maven.apache.org
> > > Subject: Proxy settings
> > > 
> > > Hello,
> > > 
> > > We're using maven for internal development. Since the 
> > > internet as a whole 
> > > and our connection to it especially are not always reliable 
> > > (for example, 
> > > a new version of a virus checker sometimes starts to 
> block out maven 
> > > downloads), we wanted to use Archiva as a local cache of the 
> > > central maven 
> > > repositories.
> > > 
> > > As it is right now, I have to configure each repository 
> > > individually. What 
> > > we would prefer is a setting which makes Archiva the default 
> > > proxy for 
> > > maven so all external connections are made over it.
> > > 
> > > This would allow us to keep local copies of all artefacts 
> so internet 
> > > outages wouldn't affect us anymore. Also, we could fix broken 
> > > packages 
> > > locally. Ideally, there should be two caches: One with stable 
> > > version for 
> > > development and one which can update itself with the current 
> > > versions from 
> > > the internet.
> > > 
> > > Is this possible?
> > > 
> > > Regards,
> > > 
> > > -- 
> > > Aaron Digulla
> > > 
> > > 
> 
> 

Antwort: RE: Proxy settings

Posted by Aa...@Globus.ch.
Hi Daniel,

What do I do if POM.xml of a plugin says this:

<repositories>
    <repository>
        <id>apache-snapshots</id>
        <name>Snapshot repository</name>
        <url>http://people.apache.org/maven-snapshot-repository/</url>
    </repository>
</repositories>

but the plugin cannot be found in this repository? Like in the JSP 
compiler maven plugin from codehaus.

My problem is the <id>. Every project defines their own id. For some, it's 
"codehaus", for others it's "codehaus.org". For another group, "codehaus" 
is for releases, while "codehaus.org" is for snapshots.

This means the id *cannot* be used to map mirrors to URLs.

Therefore, I need a solution in archiva which I can feed with arbitrary 
URLs and which either goes to a stable inhouse repository or downloads the 
resource from the URL and caches it.

Having users define proxied repositories manually and map them to managed 
repositories is not the solution, it's another layer of problems. Archia 
should support a generic proxy/cache which just stores a resource under an 
URL. So when I ask for apache.org/.../plugin-1.3.pom and for 
codehaus.org/.../plugin-1.3.pom, I should get two different files if they 
are different on the respective servers.

On disk, you can just use the hostname as the first item in the path to 
distinguish between the different artefacts.

In the webapp, it should be possible to "freeze" certain URLs (for 
example, if the files on the web are broken or I'm using a patched version 
inhouse).

With this solution, I could use the Maven proxy settings (instead of the 
broken mirror stuff) to download artefacts for my development team *once*.

Regards,

-- 
Aaron Digulla

"Mohni, Daniel" <da...@ch.unisys.com> schrieb am 04.12.2006 
11:31:28:

> Hello Aaron
> 
> this can be done setting the mirror in settings.xml
> 
>  <mirrors>
>    <mirror>
>      <id>proxy.central</id>
>    <mirrorOf>central</mirrorOf>
>         <name>Internal Mirror of central.</name>
>    <url>http://archiva/proxy/maven_release</url>
>     </mirror>
>   </mirrors>
> 
> -> if you use proxy in the url then archiva will try to download
>    missing artefacts from the proxied repo setup in archiva
> 
>    http://archiva/proxy/maven_release
> 
> -> if you use repository in the url then archiva will only be
>    a cache provider for your already downloaded artefacts
> 
>    http://archiva/repository/maven_release
> 
> maven_release is our internal proxy repository...
> 
> I don't know if this is still like this in the current daily build
> as I didn't tried it...
> 
> hth
> 
> Daniel
> 
> > -----Original Message-----
> > From: Aaron.Digulla@Globus.ch [mailto:Aaron.Digulla@Globus.ch] 
> > Sent: Monday, December 04, 2006 11:19 AM
> > To: archiva-users@maven.apache.org
> > Subject: Proxy settings
> > 
> > Hello,
> > 
> > We're using maven for internal development. Since the 
> > internet as a whole 
> > and our connection to it especially are not always reliable 
> > (for example, 
> > a new version of a virus checker sometimes starts to block out maven 
> > downloads), we wanted to use Archiva as a local cache of the 
> > central maven 
> > repositories.
> > 
> > As it is right now, I have to configure each repository 
> > individually. What 
> > we would prefer is a setting which makes Archiva the default 
> > proxy for 
> > maven so all external connections are made over it.
> > 
> > This would allow us to keep local copies of all artefacts so internet 
> > outages wouldn't affect us anymore. Also, we could fix broken 
> > packages 
> > locally. Ideally, there should be two caches: One with stable 
> > version for 
> > development and one which can update itself with the current 
> > versions from 
> > the internet.
> > 
> > Is this possible?
> > 
> > Regards,
> > 
> > -- 
> > Aaron Digulla
> > 
> > 


RE: Proxy settings

Posted by "Mohni, Daniel" <da...@ch.unisys.com>.
Hello Aaron

this can be done setting the mirror in settings.xml

 <mirrors>
   <mirror>
     <id>proxy.central</id>
	<mirrorOf>central</mirrorOf>
     	<name>Internal Mirror of central.</name>
	<url>http://archiva/proxy/maven_release</url>
    </mirror>
  </mirrors>

-> if you use proxy in the url then archiva will try to download
   missing artefacts from the proxied repo setup in archiva

	http://archiva/proxy/maven_release
   
-> if you use repository in the url then archiva will only be
   a cache provider for your already downloaded artefacts

	http://archiva/repository/maven_release

maven_release is our internal proxy repository...

I don't know if this is still like this in the current daily build
as I didn't tried it...

hth

Daniel

> -----Original Message-----
> From: Aaron.Digulla@Globus.ch [mailto:Aaron.Digulla@Globus.ch] 
> Sent: Monday, December 04, 2006 11:19 AM
> To: archiva-users@maven.apache.org
> Subject: Proxy settings
> 
> Hello,
> 
> We're using maven for internal development. Since the 
> internet as a whole 
> and our connection to it especially are not always reliable 
> (for example, 
> a new version of a virus checker sometimes starts to block out maven 
> downloads), we wanted to use Archiva as a local cache of the 
> central maven 
> repositories.
> 
> As it is right now, I have to configure each repository 
> individually. What 
> we would prefer is a setting which makes Archiva the default 
> proxy for 
> maven so all external connections are made over it.
> 
> This would allow us to keep local copies of all artefacts so internet 
> outages wouldn't affect us anymore. Also, we could fix broken 
> packages 
> locally. Ideally, there should be two caches: One with stable 
> version for 
> development and one which can update itself with the current 
> versions from 
> the internet.
> 
> Is this possible?
> 
> Regards,
> 
> -- 
> Aaron Digulla
> 
>