You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Bernd Eckenfels <ec...@zusammenkunft.net> on 2014/03/12 03:42:46 UTC

Re: Maven 3.1.1 dependency downloading issues

Hello,

Am Tue, 11 Mar 2014 09:20:57 +0000
schrieb "Mao, James(Maode)" <mm...@ebay.com>:

> Hi,
> 
> I found that Maven 3.1.1 will try downloading the artifacts in
> parallel.
> This cause the issue, actually the first try already downloaded the
> pom, but Maven still trying other repository in paralle.

Not sure which issue?

> In our CI
> server we cannot access repository.jboss.org. that cause the system
> hang until it's timeout.

You typically add a mirror to external repositories onto your local
repository. Then maven can get those artifacts and you will be able to
archive a local copy to make your build process reproducible.

> l  Can we configure the threads number for parallel downloading.

This is a 2.1 feature, it is described in the maven guide:

http://maven.apache.org/guides/mini/guide-configuring-maven.html

> l  Why Maven 3.1.1 will try to download artifacts from
> repository.jboss.org, we did not define in our settings.xml and pom.

You have most likely some POMs in your project from JBoss/Redhat which
have itself defined the JBoss repository. If it rresolves your
dependencies it will download the other resources from the repositories
defined in those dependend projects. 

> Can we remove those external repositories?

You could have a look at the -X debug output and <exclude> the
dependencies which have those repository requirements, but as I wrote
above you typically have to operate a mirror sooner or later.

BTW: no need to ask on both maven lists, the users list is perfectly
fine, will remove the developer list from the distributon.

Greertings
Bernd

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


Re: Maven 3.1.1 dependency downloading issues

Posted by Bernd Eckenfels <ec...@zusammenkunft.net>.
Hello,

you can also use 

<mirrorOf>!myrepo,!plugin,*</mirrorOf>

But generally it is sooner or later a good idea to have a repository
manager like nexus or archiva which has a special proxy support and
allows to define virtual repositories (consiting of repository
groupsand proxied repositories)

Greetings
Bernd


Am Thu, 13 Mar 2014 02:07:25 -0400
schrieb Ron Wheeler <rw...@artifact-software.com>:

> Your proxy repo should be proxying all of the hosted repos that you
> want to search.
> Point maven at your proxy not the hosted repos
> 
> On 13/03/2014 1:56 AM, James Mao wrote:
> > Hi Wayne,
> >
> > Thanks for the quick reply.
> >
> > But not everything is in
> > <url>http://mycentral/content/repositories/central</url>
> >
> > I also have http://mycentral/content/repositories/releases,
> > http://mycentral/content/repositories/plugins,
> > http://mycentral/content/repositories/snapshots.
> >
> > If used<mirrorOf>*</mirrorOf>, everything asked will go to
> > http://mycentral/content/repositories/central.
> >
> > Can you give more suggestions?
> >
> > Thanks,
> > James
> >
> >
> >
> >
> > --
> > View this message in context:
> > http://maven.40175.n5.nabble.com/Re-Maven-3-1-1-dependency-downloading-issues-tp5788056p5788188.html
> > Sent from the Maven - Users mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > 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: Maven 3.1.1 dependency downloading issues

Posted by Ron Wheeler <rw...@artifact-software.com>.
Your proxy repo should be proxying all of the hosted repos that you want 
to search.
Point maven at your proxy not the hosted repos

On 13/03/2014 1:56 AM, James Mao wrote:
> Hi Wayne,
>
> Thanks for the quick reply.
>
> But not everything is in
> <url>http://mycentral/content/repositories/central</url>
>
> I also have http://mycentral/content/repositories/releases,
> http://mycentral/content/repositories/plugins,
> http://mycentral/content/repositories/snapshots.
>
> If used<mirrorOf>*</mirrorOf>, everything asked will go to
> http://mycentral/content/repositories/central.
>
> Can you give more suggestions?
>
> Thanks,
> James
>
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Re-Maven-3-1-1-dependency-downloading-issues-tp5788056p5788188.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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


Re: Maven 3.1.1 dependency downloading issues

Posted by James Mao <mm...@ebay.com>.
Hi Wayne,

Thanks for the quick reply.

But not everything is in 
<url>http://mycentral/content/repositories/central</url>

I also have http://mycentral/content/repositories/releases,
http://mycentral/content/repositories/plugins,
http://mycentral/content/repositories/snapshots.

If used<mirrorOf>*</mirrorOf>, everything asked will go to
http://mycentral/content/repositories/central.

Can you give more suggestions?

Thanks,
James




--
View this message in context: http://maven.40175.n5.nabble.com/Re-Maven-3-1-1-dependency-downloading-issues-tp5788056p5788188.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven 3.1.1 dependency downloading issues

Posted by Wayne Fay <wa...@gmail.com>.
>                         <mirrorOf>central</mirrorOf>
...
> I am wondering why some artifacts still downloading from other repo, here
...
> How can i stop downloading from other repository?

The mirrorOf value should be an asterisk/star, as I stated before:
>> <mirrorOf>*</mirrorOf> which will capture all repo requests, and

Wayne

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


Re: Maven 3.1.1 dependency downloading issues

Posted by James Mao <mm...@ebay.com>.
Thanks Wayne, i am using mirror in my system
 <mirrors>
                <mirror>
                        <id>central</id>
                        <mirrorOf>central</mirrorOf>
                       
<url>http://mycentral/content/repositories/central</url>
                </mirror>
        </mirrors>

I am wondering why some artifacts still downloading from other repo, here
are example:
02:13:12  [INFO] Downloading:
http://mycentral/content/repositories/central/org/antlr/stringtemplate/3.2/stringtemplate-3.2.pom
02:13:13  [INFO] Downloaded:
http://mycentral/content/repositories/central/org/antlr/stringtemplate/3.2/stringtemplate-3.2.pom
(2 KB at 68.2 KB/sec)
02:13:13  [INFO] Downloading:
http://mycentral/content/repositories/releases/org/antlr/stringtemplate/3.2/stringtemplate-3.2.pom
02:13:13  [INFO] Downloading:
http://mycentral/content/repositories/plugins/org/antlr/stringtemplate/3.2/stringtemplate-3.2.pom
02:13:13  [INFO] Downloading:
http://antlr.org/antlr-snapshot/org/antlr/stringtemplate/3.2/stringtemplate-3.2.pom

The POM actually downloaded already from mycentral, but it's still try to
download from http://antlr.org.

Looks like this repository is defined in the parent POM of stringtemplate.

How can i stop downloading from other repository?

I am using Maven 3.1.1




--
View this message in context: http://maven.40175.n5.nabble.com/Re-Maven-3-1-1-dependency-downloading-issues-tp5788056p5788183.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven 3.1.1 dependency downloading issues

Posted by Wayne Fay <wa...@gmail.com>.
> If it's correct, seems my options are
> 1. configure the threads to just 1, so mycental always the first one to try.
> 2. block all external repositories, just left mycentral.

Generally speaking, I'd expect you should have a <mirror> for this
"mycentral" defined in settings.xml with a configuration of
<mirrorOf>*</mirrorOf> which will capture all repo requests, and then
you don't have to worry so much about these other repos finding their
way into your build.

Wayne

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


RE: Maven 3.1.1 dependency downloading issues

Posted by "Mao, James(Maode)" <mm...@ebay.com>.
Hi Bernd,

Thanks for the quick response.

For example, my project's pom defined only one repository (mycentral), but the dependencies maybe defined three other repository (jboss/redhat/codehaus)

In Maven 3.0.5, I guess it download artifacts from 4 repos one by one, so mycentral is the first one to try, and if it gets artifact from that repo, and it's done. It will not try to download from the rest repos.

In Maven 3.1.1, I guess it starts 4 threads to download artifact from 4 repos in parallel, so here comes the issue. in my server, I cannot access jboss/redhat/codehaus, I can only access mycentral. So the 1st thread get the artifact, but the other three threads are still trying to download the artifacts from jboss/redhat/codehaus, which are not accessible. and it's blocked until timeout, so this really slow down the build.

I am not sure if what I am saying is correct behavior for Maven 3.1.1.

If it's correct, seems my options are
1. configure the threads to just 1, so mycental always the first one to try. 
2. block all external repositories, just left mycentral.

Any other suggestions?

Thanks,
James

-----Original Message-----
From: Bernd Eckenfels [mailto:ecki@zusammenkunft.net] 
Sent: Wednesday, March 12, 2014 10:43 AM
To: Mao, James(Maode)
Cc: users@maven.apache.org
Subject: Re: Maven 3.1.1 dependency downloading issues

Hello,

Am Tue, 11 Mar 2014 09:20:57 +0000
schrieb "Mao, James(Maode)" <mm...@ebay.com>:

> Hi,
> 
> I found that Maven 3.1.1 will try downloading the artifacts in 
> parallel.
> This cause the issue, actually the first try already downloaded the 
> pom, but Maven still trying other repository in paralle.

Not sure which issue?

> In our CI
> server we cannot access repository.jboss.org. that cause the system 
> hang until it's timeout.

You typically add a mirror to external repositories onto your local repository. Then maven can get those artifacts and you will be able to archive a local copy to make your build process reproducible.

> l  Can we configure the threads number for parallel downloading.

This is a 2.1 feature, it is described in the maven guide:

http://maven.apache.org/guides/mini/guide-configuring-maven.html

> l  Why Maven 3.1.1 will try to download artifacts from 
> repository.jboss.org, we did not define in our settings.xml and pom.

You have most likely some POMs in your project from JBoss/Redhat which have itself defined the JBoss repository. If it rresolves your dependencies it will download the other resources from the repositories defined in those dependend projects. 

> Can we remove those external repositories?

You could have a look at the -X debug output and <exclude> the dependencies which have those repository requirements, but as I wrote above you typically have to operate a mirror sooner or later.

BTW: no need to ask on both maven lists, the users list is perfectly fine, will remove the developer list from the distributon.

Greertings
Bernd

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