You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Wang, Simon" <Yu...@ebay.com> on 2012/10/11 05:16:46 UTC

How to optimize maven dependencies to get better performance?

Hi, 
   We're in trouble of terrible performance on resolve maven dependencies.
I did some search about it. Basically below ways should be helpful:

1. optimize nexus server to improve response time.
2. optimize maven dependencies. 
  1) avoid duplicated dependencies
  2) avoid dependency conflict cases
  3)....

Any others suggestions?

Regards
Simon

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


Re: How to optimize maven dependencies to get better performance?

Posted by "Lyons, Roy" <Ro...@cmegroup.com>.
Tim's idea could workŠ  however, I could say that a shorter term fix might
help (if you aren't already on maven 3.0.4)

--snip--
With 3.0.4, the default wagon http(s) is now the HttpClient based on
Apache Http Client 4.1.2 <http://hc.apache.org/httpcomponents-client-ga>.
 There is now a http connection pooling to prevent reopening http(s) to
remote server for each requests. This pool feature is configurable with
some parameters [4].
This new defaut wagon comes with some default configuration:

* http(s) connection pool: default to 20.
* readTimeout: default to 1800000ms (~30 minutes) (see section Read time
out below)
* default Preemptive Authentication.
--/snip--

Taken from http://maven.apache.org/guides/mini/guide-http-settings.html


I do see a couple of obstacles to Tim's ideas.  Most of them are related
to bad practices which are regularly evangelized as good ideasŠ  like
using variables for version names (I am looking at you Atlassian
[http://blogs.atlassian.com/2010/09/bamboo_jira_release_management_plugin_p
art_2/]).



Another snippet (I didn't read this before this discussion thread and it
enlightened me)


--snip--

Maven Wagon HTTPThis project is an implementation of Wagon provider for
HTTP access. It uses Apache HttpComponents client
<http://hc.apache.org/httpcomponents-client-ga/> as lower level layer.
It enables Maven to use remote repositories stored in HTTP servers.

FeaturesPrior
 to version 2.0, a pooled http connection manager is used. The pooled
feature is enabled by default, you can configure it trough the following
 system properties :

* maven.wagon.http.pool = true/false (default true), enable/disable the
pooled mechanism.
* maven.wagon.httpconnectionManager.maxPerRoute = integer (default : 20),
maximum number of http(s) connection per destination.
* maven.wagon.httpconnectionManager.maxTotal = integer (default 40),
maximum number of htp(s) connection.
* maven.wagon.http.ssl.easy = true/false (default true), enable/disable
use of easy ssl check for user generated certificates.
* maven.wagon.http.ssl.allowall
 = true/false (default true), enable/disable match of the server's X.509
 certificate. If disable, a browser like check will be used.
* maven.wagon.http.ssl.ignore.validity.dates = true/false (default true),
ignore issue with certifactes dates.
* maven.wagon.rto=time in ms (default 1800000) read time out.

--/snip--

Taken from 
http://maven.apache.org/wagon/wagon-providers/wagon-http/index.html



AlsoŠ  You could start your day out with mvn dependency:go-offline -- and
then add --offline for subsequent compilations throughout the day.



Thanks,

Roy Lyons
Senior Configuration Engineer




On 10/11/12 4:01 AM, "Martin Höller" <ma...@xss.co.at> wrote:

>On 11 Okt 2012, Wang, Simon wrote:
>
>> Hi, Barrie,
>>    That's really helpful!
>> 
>>    Even I have local cache, it also takes about 2 mins to resolve
>>dependencies.
>>    Also it seems maven still will talk with remote maven server even I
>>have local cache.
>
>You could try "mvn -o" and see if this helps.
>
>And maybe this blog post of Tim O'Brien might be of interest:
>http://www.sonatype.com/people/2012/08/download-it-all-at-once-a-maven-ide
>a/
>
>hth,
>- martin


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


Re: How to optimize maven dependencies to get better performance?

Posted by Martin Höller <ma...@xss.co.at>.
On 11 Okt 2012, Wang, Simon wrote:

> Hi, Barrie,
>    That's really helpful!
> 
>    Even I have local cache, it also takes about 2 mins to resolve dependencies.
>    Also it seems maven still will talk with remote maven server even I have local cache.

You could try "mvn -o" and see if this helps.

And maybe this blog post of Tim O'Brien might be of interest:
http://www.sonatype.com/people/2012/08/download-it-all-at-once-a-maven-idea/

hth,
- martin

Re: How to optimize maven dependencies to get better performance?

Posted by Wayne Fay <wa...@gmail.com>.
> Running mvn -X will output the same level of dependency resolution
> information plus you should get enough of a feel for where the actual
> slowness is.
> And then we can start looking at speeding up that slowness.
> At the moment it feels like there is too much assumption and guesswork
> to point to the correct steps.

Agreed. Here are just a few of the possibilities:
a) multiple repos defined in your pom (perhaps some aren't even valid)
despite having an MRM deployed
b) artifacts deployed with no pom requiring lookups during each build
(times multiple repos?)
c) lots of snapshots with overzealous update intervals (times multiple repos?)
d) other related things that we see time and time again which cause
builds to take a while

Without seeing the debug output with -X, we're just making uneducated
assumptions which is not helpful. Simon, please capture the -X output
and post to gist or pastebin so we can help you get things working
better.

Wayne

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


Re: How to optimize maven dependencies to get better performance?

Posted by Barrie Treloar <ba...@gmail.com>.
On Fri, Oct 12, 2012 at 12:49 AM, Lyons, Roy <Ro...@cmegroup.com> wrote:
> Ooh.  More on the original topic (big old trees and having to sort through
> stuff)
>
> mvn dependency:tree -Dverbose=true
>
> That¹s a powerful tool in your pruning crusade.  Putting verbose on will
> tell you about the decisions maven made in deciding which dependency
> versions to keep and where they came from.  Using this, you could also
> figure out what items you might like to put in <exclusions> block of
> dependency declarations.  Most likely you aren't using everything in your
> dependencies and you can figure out what fat you want to trimŠ
>
> Of course, this is the most intrusive and time consuming optionŠ  but I
> suspect that it will yield the greatest results.

With the recent(ish) change to aether for dependency resolution the
dependency plugin doesn't resolve the same information.
That has either been fixed, or is in the work of being fixed.

Running mvn -X will output the same level of dependency resolution
information plus you should get enough of a feel for where the actual
slowness is.
And then we can start looking at speeding up that slowness.
At the moment it feels like there is too much assumption and guesswork
to point to the correct steps.

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


Re: How to optimize maven dependencies to get better performance?

Posted by "Lyons, Roy" <Ro...@cmegroup.com>.
Ooh.  More on the original topic (big old trees and having to sort through
stuff)

mvn dependency:tree -Dverbose=true

That¹s a powerful tool in your pruning crusade.  Putting verbose on will
tell you about the decisions maven made in deciding which dependency
versions to keep and where they came from.  Using this, you could also
figure out what items you might like to put in <exclusions> block of
dependency declarations.  Most likely you aren't using everything in your
dependencies and you can figure out what fat you want to trimŠ

Of course, this is the most intrusive and time consuming optionŠ  but I
suspect that it will yield the greatest results.




Thanks,

Roy Lyons
Senior Configuration Engineer
(312) 648-3659 [w] 
(773) 551-8335 [c] 
Roy.Lyons@cmegroup.com
<mailto:Roy.Lyons@cmegroup.com?subject=Contact%20from%20email%20signature>
CME Group 
20 S. Wacker Drive
Chicago, Illinois 60606
Self Help 
https://wiki.chicago.cme.com/confluence/display/CM/Home






On 10/11/12 9:02 AM, "Barrie Treloar" <ba...@gmail.com> wrote:

>On Thu, Oct 11, 2012 at 6:57 PM, Wang, Simon <Yu...@ebay.com>
>wrote:
>> Hi, Barrie,
>>    Ask a stupid question about enforcer plugin.
>> I added enforcer plugin into project pom like this:
>>                         <plugin>
>>                 
>><groupId>org.apache.maven.plugins</groupId>
>>                 
>><artifactId>maven-enforcer-plugin</artifactId>
>>                                         <version>1.1.1</version>
>>                                         <executions>
>>                                           <execution>
>>                                                 <id>enforce</id>
>>                                                 <configuration>
>>                                                         <rules>
>>                 
>><DependencyConvergence/>
>>                                                         </rules>
>>                                                 </configuration>
>>                                                 <goals>
>>                                                   <goal>enforce</goal>
>>                                                 </goals>
>>                                           </execution>
>>                                         </executions>
>>                         </plugin>
>
>I'm not sure, your example is a copy-and-paste of
>http://maven.apache.org/enforcer/enforcer-rules/dependencyConvergence.html
>
>However I would normally expect things to be case sensitive and the
>rule index (http://maven.apache.org/enforcer/enforcer-rules/index.html)
>uses "dependencyConvergence"
>
>You could try that instead.
>If it does work, I'd file a bug against the enforcer documentation.
>
>Also, I dont expect dependencyConvergence to actually help you with
>performance.
>Try running maven with -X and then scouring the copious amount of
>output to see what it is doing and where it is spending its time.
>Always measure before you optimize.
>
>---------------------------------------------------------------------
>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: How to optimize maven dependencies to get better performance?

Posted by Barrie Treloar <ba...@gmail.com>.
On Thu, Oct 11, 2012 at 6:57 PM, Wang, Simon <Yu...@ebay.com> wrote:
> Hi, Barrie,
>    Ask a stupid question about enforcer plugin.
> I added enforcer plugin into project pom like this:
>                         <plugin>
>                                         <groupId>org.apache.maven.plugins</groupId>
>                                         <artifactId>maven-enforcer-plugin</artifactId>
>                                         <version>1.1.1</version>
>                                         <executions>
>                                           <execution>
>                                                 <id>enforce</id>
>                                                 <configuration>
>                                                         <rules>
>                                                                 <DependencyConvergence/>
>                                                         </rules>
>                                                 </configuration>
>                                                 <goals>
>                                                   <goal>enforce</goal>
>                                                 </goals>
>                                           </execution>
>                                         </executions>
>                         </plugin>

I'm not sure, your example is a copy-and-paste of
http://maven.apache.org/enforcer/enforcer-rules/dependencyConvergence.html

However I would normally expect things to be case sensitive and the
rule index (http://maven.apache.org/enforcer/enforcer-rules/index.html)
uses "dependencyConvergence"

You could try that instead.
If it does work, I'd file a bug against the enforcer documentation.

Also, I dont expect dependencyConvergence to actually help you with performance.
Try running maven with -X and then scouring the copious amount of
output to see what it is doing and where it is spending its time.
Always measure before you optimize.

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


RE: How to optimize maven dependencies to get better performance?

Posted by "Wang, Simon" <Yu...@ebay.com>.
Sorry, reply it too late.

Brian, you're right, after move it out, works for me. Thanks!

Regards
Simon
-----Original Message-----
From: Brian Fox [mailto:brianf@infinity.nu] 
Sent: 2012年10月16日 19:30
To: Maven Users List
Subject: Re: How to optimize maven dependencies to get better performance?

The problem below is because your configuration is inside an execution, which when run from the command line like mvm enforcer:enforce won't be activated. Either bind this plugin to a phase as part of your build, or move the configuration element outside the executions block.

On Thu, Oct 11, 2012 at 4:27 AM, Wang, Simon <Yu...@ebay.com> wrote:

> Hi, Barrie,
>    Ask a stupid question about enforcer plugin.
> I added enforcer plugin into project pom like this:
>                         <plugin>
>
> <groupId>org.apache.maven.plugins</groupId>
>
> <artifactId>maven-enforcer-plugin</artifactId>
>                                         <version>1.1.1</version>
>                                         <executions>
>                                           <execution>
>                                                 <id>enforce</id>
>                                                 <configuration>
>                                                         <rules>
>
> <DependencyConvergence/>
>                                                         </rules>
>                                                 </configuration>
>                                                 <goals>
>                                                   <goal>enforce</goal>
>                                                 </goals>
>                                           </execution>
>                                         </executions>
>                         </plugin>
>
> But it always complain missing parameter: rules.
> Below is debug log.
>
> Any mistakes in above code?
>
> ~~~
> [DEBUG] Configuring mojo
> org.apache.maven.plugins:maven-enforcer-plugin:1.1.1:en
> force from plugin realm
> ClassRealm[plugin>org.apache.maven.plugins:maven-enforce
> r-plugin:1.1.1, parent: sun.misc.Launcher$AppClassLoader@233e233e]
> [DEBUG] Configuring mojo
> 'org.apache.maven.plugins:maven-enforcer-plugin:1.1.1:e
> nforce' with basic configurator -->
> [DEBUG]   (s) fail = true
> [DEBUG]   (s) failFast = false
> [DEBUG]   (f) ignoreCache = false
> [DEBUG]   (s) project = MavenProject:
> com.ebay.raptor.buyerexp.framework:CoreApp
> Framework:4.1.1-W41-SNAPSHOT @
> C:\gitrepo\search_raptor\CoreAppFramework\pom.xml
>
> [DEBUG]   (s) session = org.apache.maven.execution.MavenSession@3d153d15
> [DEBUG]   (s) skip = false
> [DEBUG] -- end configuration --
> [INFO]
> ----------------------------------------------------------------------
> --
> [INFO] BUILD FAILURE
> [INFO]
> ----------------------------------------------------------------------
> --
> [INFO] Total time: 3.050s
> [INFO] Finished at: Thu Oct 11 15:49:28 CST 2012 [INFO] Final Memory: 
> 17M/45M [INFO]
> ----------------------------------------------------------------------
> --
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-enforcer-plugin:1.
> 1.1:enforce (default-cli) on project CoreAppFramework: The parameters 
> 'rules' fo r goal 
> org.apache.maven.plugins:maven-enforcer-plugin:1.1.1:enforce are 
> missing or invalid -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to 
> execute goal o 
> rg.apache.maven.plugins:maven-enforcer-plugin:1.1.1:enforce 
> (default-cli) on pro ject CoreAppFramework: The parameters 'rules' for 
> goal
> org.apache.maven.plugins:
> maven-enforcer-plugin:1.1.1:enforce are missing or invalid
>         at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
> .java:221)
>
>
>
> Regards
> Simon
> -----Original Message-----
> From: Wang, Simon [mailto:Yunfeng.Wang@ebay.com]
> Sent: 2012年10月11日 13:41
> To: Maven Users List
> Subject: RE: How to optimize maven dependencies to get better performance?
>
> Hi, Barrie,
>    That's really helpful!
>
>    Even I have local cache, it also takes about 2 mins to resolve 
> dependencies.
>    Also it seems maven still will talk with remote maven server even I 
> have local cache.
>    Yes, maybe it's caused by unspecified version numbers for dependencies.
>
>    I'll try maven-enforcer-plugin.
>
>    We're using nexus now, haven't tried MRM, I'll host it and compare 
> it to nexus.
>
>    And I saw aether(major in dependency resolving) will take longer 
> time to resolve conflict dependencies.
>    Is it also a point that need to be improved?
>    Do you know is there any maven plugin to identify conflict dependencies?
>
> Regards
> Simon
>
> -----Original Message-----
> From: Barrie Treloar [mailto:baerrach@gmail.com]
> Sent: 2012年10月11日 11:48
> To: Maven Users List
> Subject: Re: How to optimize maven dependencies to get better performance?
>
> On Thu, Oct 11, 2012 at 1:46 PM, Wang, Simon <Yu...@ebay.com>
> wrote:
> > Hi,
> >    We're in trouble of terrible performance on resolve maven
> dependencies.
> > I did some search about it. Basically below ways should be helpful:
> >
> > 1. optimize nexus server to improve response time.
> > 2. optimize maven dependencies.
> >   1) avoid duplicated dependencies
> >   2) avoid dependency conflict cases
> >   3)....
> >
> > Any others suggestions?
>
> What specifically is your problem?
>
> I can only guess at what you mean.
> I'm assuming that when you run "mvn install" that maven is reaching 
> out to check for new dependencies which can be time consuming, 
> especially with an empty ~/.m2/repository local cache.
> After the first install this shouldn't be a problem.
>
> Firstly make sure that you do not define additional "repository" in 
> either your settings.xml or pom.xml.
> Every dependency will be checked against all repositories defined.
> So just by defining one extra repository will double the time it takes 
> to check dependencies.
> There is no logic in Maven to blacklist/whitelist what artifacts are 
> located where, this is one reason why you use a Repository Manager.
> You can see that if you declare repositories in your pom.xml and this 
> is published how it will affect everyone that includes your artifacts.
> Please don't do that.
>
> Secondly, make sure you lock down all version numbers of dependencies.
> It is bad practice to not specify these as it makes your build 
> non-reproducable.
> This could also be a reason why it is slow as Maven will need to check 
> periodically to see if new versions are available.
> You can use maven enforcer
> (http://maven.apache.org/plugins/maven-enforcer-plugin/) to ensure 
> that you have no unversioned artifacts.
>
> Thirdly, install a Maven Repository Manager (Nexus is one).
> This will act as a local proxy and make downloading times much faster.
> It also provides an aggregation point, so that there is only one 
> repository to check each artifact for and the Repository Manager will 
> hide checking the other repos MRMs also allow you to do 
> whitelist/blacklist stuff to improve performance.
> If you are in a corporate environment you really want an MRM installed.
>
> ---------------------------------------------------------------------
> 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: How to optimize maven dependencies to get better performance?

Posted by Brian Fox <br...@infinity.nu>.
The problem below is because your configuration is inside an execution,
which when run from the command line like mvm enforcer:enforce won't be
activated. Either bind this plugin to a phase as part of your build, or
move the configuration element outside the executions block.

On Thu, Oct 11, 2012 at 4:27 AM, Wang, Simon <Yu...@ebay.com> wrote:

> Hi, Barrie,
>    Ask a stupid question about enforcer plugin.
> I added enforcer plugin into project pom like this:
>                         <plugin>
>
> <groupId>org.apache.maven.plugins</groupId>
>
> <artifactId>maven-enforcer-plugin</artifactId>
>                                         <version>1.1.1</version>
>                                         <executions>
>                                           <execution>
>                                                 <id>enforce</id>
>                                                 <configuration>
>                                                         <rules>
>
> <DependencyConvergence/>
>                                                         </rules>
>                                                 </configuration>
>                                                 <goals>
>                                                   <goal>enforce</goal>
>                                                 </goals>
>                                           </execution>
>                                         </executions>
>                         </plugin>
>
> But it always complain missing parameter: rules.
> Below is debug log.
>
> Any mistakes in above code?
>
> ~~~
> [DEBUG] Configuring mojo
> org.apache.maven.plugins:maven-enforcer-plugin:1.1.1:en
> force from plugin realm
> ClassRealm[plugin>org.apache.maven.plugins:maven-enforce
> r-plugin:1.1.1, parent: sun.misc.Launcher$AppClassLoader@233e233e]
> [DEBUG] Configuring mojo
> 'org.apache.maven.plugins:maven-enforcer-plugin:1.1.1:e
> nforce' with basic configurator -->
> [DEBUG]   (s) fail = true
> [DEBUG]   (s) failFast = false
> [DEBUG]   (f) ignoreCache = false
> [DEBUG]   (s) project = MavenProject:
> com.ebay.raptor.buyerexp.framework:CoreApp
> Framework:4.1.1-W41-SNAPSHOT @
> C:\gitrepo\search_raptor\CoreAppFramework\pom.xml
>
> [DEBUG]   (s) session = org.apache.maven.execution.MavenSession@3d153d15
> [DEBUG]   (s) skip = false
> [DEBUG] -- end configuration --
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 3.050s
> [INFO] Finished at: Thu Oct 11 15:49:28 CST 2012
> [INFO] Final Memory: 17M/45M
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-enforcer-plugin:1.
> 1.1:enforce (default-cli) on project CoreAppFramework: The parameters
> 'rules' fo
> r goal org.apache.maven.plugins:maven-enforcer-plugin:1.1.1:enforce are
> missing
> or invalid -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute
> goal o
> rg.apache.maven.plugins:maven-enforcer-plugin:1.1.1:enforce (default-cli)
> on pro
> ject CoreAppFramework: The parameters 'rules' for goal
> org.apache.maven.plugins:
> maven-enforcer-plugin:1.1.1:enforce are missing or invalid
>         at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
> .java:221)
>
>
>
> Regards
> Simon
> -----Original Message-----
> From: Wang, Simon [mailto:Yunfeng.Wang@ebay.com]
> Sent: 2012年10月11日 13:41
> To: Maven Users List
> Subject: RE: How to optimize maven dependencies to get better performance?
>
> Hi, Barrie,
>    That's really helpful!
>
>    Even I have local cache, it also takes about 2 mins to resolve
> dependencies.
>    Also it seems maven still will talk with remote maven server even I
> have local cache.
>    Yes, maybe it's caused by unspecified version numbers for dependencies.
>
>    I'll try maven-enforcer-plugin.
>
>    We're using nexus now, haven't tried MRM, I'll host it and compare it
> to nexus.
>
>    And I saw aether(major in dependency resolving) will take longer time
> to resolve conflict dependencies.
>    Is it also a point that need to be improved?
>    Do you know is there any maven plugin to identify conflict dependencies?
>
> Regards
> Simon
>
> -----Original Message-----
> From: Barrie Treloar [mailto:baerrach@gmail.com]
> Sent: 2012年10月11日 11:48
> To: Maven Users List
> Subject: Re: How to optimize maven dependencies to get better performance?
>
> On Thu, Oct 11, 2012 at 1:46 PM, Wang, Simon <Yu...@ebay.com>
> wrote:
> > Hi,
> >    We're in trouble of terrible performance on resolve maven
> dependencies.
> > I did some search about it. Basically below ways should be helpful:
> >
> > 1. optimize nexus server to improve response time.
> > 2. optimize maven dependencies.
> >   1) avoid duplicated dependencies
> >   2) avoid dependency conflict cases
> >   3)....
> >
> > Any others suggestions?
>
> What specifically is your problem?
>
> I can only guess at what you mean.
> I'm assuming that when you run "mvn install" that maven is reaching out to
> check for new dependencies which can be time consuming, especially with an
> empty ~/.m2/repository local cache.
> After the first install this shouldn't be a problem.
>
> Firstly make sure that you do not define additional "repository" in either
> your settings.xml or pom.xml.
> Every dependency will be checked against all repositories defined.
> So just by defining one extra repository will double the time it takes to
> check dependencies.
> There is no logic in Maven to blacklist/whitelist what artifacts are
> located where, this is one reason why you use a Repository Manager.
> You can see that if you declare repositories in your pom.xml and this is
> published how it will affect everyone that includes your artifacts.
> Please don't do that.
>
> Secondly, make sure you lock down all version numbers of dependencies.
> It is bad practice to not specify these as it makes your build
> non-reproducable.
> This could also be a reason why it is slow as Maven will need to check
> periodically to see if new versions are available.
> You can use maven enforcer
> (http://maven.apache.org/plugins/maven-enforcer-plugin/) to ensure that
> you have no unversioned artifacts.
>
> Thirdly, install a Maven Repository Manager (Nexus is one).
> This will act as a local proxy and make downloading times much faster.
> It also provides an aggregation point, so that there is only one
> repository to check each artifact for and the Repository Manager will hide
> checking the other repos MRMs also allow you to do whitelist/blacklist
> stuff to improve performance.
> If you are in a corporate environment you really want an MRM installed.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: How to optimize maven dependencies to get better performance?

Posted by "Wang, Simon" <Yu...@ebay.com>.
Hi, Barrie,
   Ask a stupid question about enforcer plugin.
I added enforcer plugin into project pom like this:
			<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>1.1.1</version>
					<executions>
					  <execution>
						<id>enforce</id>
						<configuration>
							<rules>
								<DependencyConvergence/>
							</rules>
						</configuration>
						<goals>
						  <goal>enforce</goal>
						</goals>
					  </execution>
					</executions>
			</plugin>

But it always complain missing parameter: rules.
Below is debug log.

Any mistakes in above code?

~~~
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-enforcer-plugin:1.1.1:en
force from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-enforce
r-plugin:1.1.1, parent: sun.misc.Launcher$AppClassLoader@233e233e]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-enforcer-plugin:1.1.1:e
nforce' with basic configurator -->
[DEBUG]   (s) fail = true
[DEBUG]   (s) failFast = false
[DEBUG]   (f) ignoreCache = false
[DEBUG]   (s) project = MavenProject: com.ebay.raptor.buyerexp.framework:CoreApp
Framework:4.1.1-W41-SNAPSHOT @ C:\gitrepo\search_raptor\CoreAppFramework\pom.xml

[DEBUG]   (s) session = org.apache.maven.execution.MavenSession@3d153d15
[DEBUG]   (s) skip = false
[DEBUG] -- end configuration --
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.050s
[INFO] Finished at: Thu Oct 11 15:49:28 CST 2012
[INFO] Final Memory: 17M/45M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.
1.1:enforce (default-cli) on project CoreAppFramework: The parameters 'rules' fo
r goal org.apache.maven.plugins:maven-enforcer-plugin:1.1.1:enforce are missing
or invalid -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.apache.maven.plugins:maven-enforcer-plugin:1.1.1:enforce (default-cli) on pro
ject CoreAppFramework: The parameters 'rules' for goal org.apache.maven.plugins:
maven-enforcer-plugin:1.1.1:enforce are missing or invalid
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:221)



Regards
Simon
-----Original Message-----
From: Wang, Simon [mailto:Yunfeng.Wang@ebay.com] 
Sent: 2012年10月11日 13:41
To: Maven Users List
Subject: RE: How to optimize maven dependencies to get better performance?

Hi, Barrie,
   That's really helpful!

   Even I have local cache, it also takes about 2 mins to resolve dependencies.
   Also it seems maven still will talk with remote maven server even I have local cache.
   Yes, maybe it's caused by unspecified version numbers for dependencies.
   
   I'll try maven-enforcer-plugin.

   We're using nexus now, haven't tried MRM, I'll host it and compare it to nexus.

   And I saw aether(major in dependency resolving) will take longer time to resolve conflict dependencies.
   Is it also a point that need to be improved?
   Do you know is there any maven plugin to identify conflict dependencies?

Regards
Simon

-----Original Message-----
From: Barrie Treloar [mailto:baerrach@gmail.com] 
Sent: 2012年10月11日 11:48
To: Maven Users List
Subject: Re: How to optimize maven dependencies to get better performance?

On Thu, Oct 11, 2012 at 1:46 PM, Wang, Simon <Yu...@ebay.com> wrote:
> Hi,
>    We're in trouble of terrible performance on resolve maven dependencies.
> I did some search about it. Basically below ways should be helpful:
>
> 1. optimize nexus server to improve response time.
> 2. optimize maven dependencies.
>   1) avoid duplicated dependencies
>   2) avoid dependency conflict cases
>   3)....
>
> Any others suggestions?

What specifically is your problem?

I can only guess at what you mean.
I'm assuming that when you run "mvn install" that maven is reaching out to check for new dependencies which can be time consuming, especially with an empty ~/.m2/repository local cache.
After the first install this shouldn't be a problem.

Firstly make sure that you do not define additional "repository" in either your settings.xml or pom.xml.
Every dependency will be checked against all repositories defined.
So just by defining one extra repository will double the time it takes to check dependencies.
There is no logic in Maven to blacklist/whitelist what artifacts are located where, this is one reason why you use a Repository Manager.
You can see that if you declare repositories in your pom.xml and this is published how it will affect everyone that includes your artifacts.
Please don't do that.

Secondly, make sure you lock down all version numbers of dependencies.
It is bad practice to not specify these as it makes your build non-reproducable.
This could also be a reason why it is slow as Maven will need to check periodically to see if new versions are available.
You can use maven enforcer
(http://maven.apache.org/plugins/maven-enforcer-plugin/) to ensure that you have no unversioned artifacts.

Thirdly, install a Maven Repository Manager (Nexus is one).
This will act as a local proxy and make downloading times much faster.
It also provides an aggregation point, so that there is only one repository to check each artifact for and the Repository Manager will hide checking the other repos MRMs also allow you to do whitelist/blacklist stuff to improve performance.
If you are in a corporate environment you really want an MRM installed.

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


Re: How to optimize maven dependencies to get better performance?

Posted by Jeff MAURY <je...@gmail.com>.
I would vote for a DNS issue

Jeff
Le 11 oct. 2012 08:08, "Ron Wheeler" <rw...@artifact-software.com> a
écrit :

> On 11/10/2012 1:40 AM, Wang, Simon wrote:
> > Hi, Barrie,
> >    That's really helpful!
> >
> >    Even I have local cache, it also takes about 2 mins to resolve
> dependencies.
> What is it doing during this time. Run maven with a detailed log to see
> each step.
>
> You might want to break your project up into modules that are smaller
> and have fewer dependencies in each one.
>
> >    Also it seems maven still will talk with remote maven server even I
> have local cache.
> It will talk to your Nexus and you need to make sure that your POMs or
> settings.xml do not refer to any other Maven Repo besides your Nexus.
> >    Yes, maybe it's caused by unspecified version numbers for
> dependencies.
> >
> Specify your versions on all dependencies
> >    I'll try maven-enforcer-plugin.
> Not sure how this will help with performance.
> >
> >    We're using nexus now, haven't tried MRM, I'll host it and compare it
> to nexus.
> Nexus is an MRM.
> >
> >    And I saw aether(major in dependency resolving) will take longer time
> to resolve conflict dependencies.
> >    Is it also a point that need to be improved?
> >    Do you know is there any maven plugin to identify conflict
> dependencies?
>
> The Eclipse IDE will do this with the m2 Eclipse plug-in. We use STS
> which is Eclipse fully loaded with everything that you need to use Maven.
>
> This is not likely going to cause a big performance hit.
> > Regards
> > Simon
> >
> > -----Original Message-----
> > From: Barrie Treloar [mailto:baerrach@gmail.com]
> > Sent: 2012年10月11日 11:48
> > To: Maven Users List
> > Subject: Re: How to optimize maven dependencies to get better
> performance?
> >
> > On Thu, Oct 11, 2012 at 1:46 PM, Wang, Simon <Yu...@ebay.com>
> wrote:
> >> Hi,
> >>    We're in trouble of terrible performance on resolve maven
> dependencies.
> >> I did some search about it. Basically below ways should be helpful:
> >>
> >> 1. optimize nexus server to improve response time.
> >> 2. optimize maven dependencies.
> >>   1) avoid duplicated dependencies
> >>   2) avoid dependency conflict cases
> >>   3)....
> >>
> >> Any others suggestions?
> > What specifically is your problem?
> >
> > I can only guess at what you mean.
> > I'm assuming that when you run "mvn install" that maven is reaching out
> to check for new dependencies which can be time consuming, especially with
> an empty ~/.m2/repository local cache.
> > After the first install this shouldn't be a problem.
> >
> > Firstly make sure that you do not define additional "repository" in
> either your settings.xml or pom.xml.
> > Every dependency will be checked against all repositories defined.
> > So just by defining one extra repository will double the time it takes
> to check dependencies.
> > There is no logic in Maven to blacklist/whitelist what artifacts are
> located where, this is one reason why you use a Repository Manager.
> > You can see that if you declare repositories in your pom.xml and this is
> published how it will affect everyone that includes your artifacts.
> > Please don't do that.
> >
> > Secondly, make sure you lock down all version numbers of dependencies.
> > It is bad practice to not specify these as it makes your build
> non-reproducable.
> > This could also be a reason why it is slow as Maven will need to check
> periodically to see if new versions are available.
> > You can use maven enforcer
> > (http://maven.apache.org/plugins/maven-enforcer-plugin/) to ensure that
> you have no unversioned artifacts.
> >
> > Thirdly, install a Maven Repository Manager (Nexus is one).
> > This will act as a local proxy and make downloading times much faster.
> > It also provides an aggregation point, so that there is only one
> repository to check each artifact for and the Repository Manager will hide
> checking the other repos MRMs also allow you to do whitelist/blacklist
> stuff to improve performance.
> > If you are in a corporate environment you really want an MRM installed.
> >
> > ---------------------------------------------------------------------
> > 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
>
>
> --
> 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: How to optimize maven dependencies to get better performance?

Posted by Anders Hammar <an...@hammar.net>.
As far as I remember yes. And I *think* that 3.0.3 is affected, but I
could be wrong. Upgrade to 3.0.4 and try again.

/Anders

On Thu, Oct 11, 2012 at 8:51 AM, Wang, Simon <Yu...@ebay.com> wrote:
> I'm using 3.0.3, is this bug related to performance?
>
> ~Simon
> -----Original Message-----
> From: anders.g.hammar@gmail.com [mailto:anders.g.hammar@gmail.com] On Behalf Of Anders Hammar
> Sent: 2012年10月11日 14:26
> To: Maven Users List; rwheeler@artifact-software.com
> Subject: Re: How to optimize maven dependencies to get better performance?
>
> I recall there was an issue with some Aether version and large dependency trees. This had an impact on one (or maybe several) of the Maven 3.0.x versions. But if you're using the latest (3.0.4) it has been fixed. Are you?
>
> /Anders
>
> On Thu, Oct 11, 2012 at 8:07 AM, Ron Wheeler <rw...@artifact-software.com> wrote:
>> On 11/10/2012 1:40 AM, Wang, Simon wrote:
>>> Hi, Barrie,
>>>    That's really helpful!
>>>
>>>    Even I have local cache, it also takes about 2 mins to resolve dependencies.
>> What is it doing during this time. Run maven with a detailed log to
>> see each step.
>>
>> You might want to break your project up into modules that are smaller
>> and have fewer dependencies in each one.
>>
>>>    Also it seems maven still will talk with remote maven server even I have local cache.
>> It will talk to your Nexus and you need to make sure that your POMs or
>> settings.xml do not refer to any other Maven Repo besides your Nexus.
>>>    Yes, maybe it's caused by unspecified version numbers for dependencies.
>>>
>> Specify your versions on all dependencies
>>>    I'll try maven-enforcer-plugin.
>> Not sure how this will help with performance.
>>>
>>>    We're using nexus now, haven't tried MRM, I'll host it and compare it to nexus.
>> Nexus is an MRM.
>>>
>>>    And I saw aether(major in dependency resolving) will take longer time to resolve conflict dependencies.
>>>    Is it also a point that need to be improved?
>>>    Do you know is there any maven plugin to identify conflict dependencies?
>>
>> The Eclipse IDE will do this with the m2 Eclipse plug-in. We use STS
>> which is Eclipse fully loaded with everything that you need to use Maven.
>>
>> This is not likely going to cause a big performance hit.
>>> Regards
>>> Simon
>>>
>>> -----Original Message-----
>>> From: Barrie Treloar [mailto:baerrach@gmail.com]
>>> Sent: 2012年10月11日 11:48
>>> To: Maven Users List
>>> Subject: Re: How to optimize maven dependencies to get better performance?
>>>
>>> On Thu, Oct 11, 2012 at 1:46 PM, Wang, Simon <Yu...@ebay.com> wrote:
>>>> Hi,
>>>>    We're in trouble of terrible performance on resolve maven dependencies.
>>>> I did some search about it. Basically below ways should be helpful:
>>>>
>>>> 1. optimize nexus server to improve response time.
>>>> 2. optimize maven dependencies.
>>>>   1) avoid duplicated dependencies
>>>>   2) avoid dependency conflict cases
>>>>   3)....
>>>>
>>>> Any others suggestions?
>>> What specifically is your problem?
>>>
>>> I can only guess at what you mean.
>>> I'm assuming that when you run "mvn install" that maven is reaching out to check for new dependencies which can be time consuming, especially with an empty ~/.m2/repository local cache.
>>> After the first install this shouldn't be a problem.
>>>
>>> Firstly make sure that you do not define additional "repository" in either your settings.xml or pom.xml.
>>> Every dependency will be checked against all repositories defined.
>>> So just by defining one extra repository will double the time it takes to check dependencies.
>>> There is no logic in Maven to blacklist/whitelist what artifacts are located where, this is one reason why you use a Repository Manager.
>>> You can see that if you declare repositories in your pom.xml and this is published how it will affect everyone that includes your artifacts.
>>> Please don't do that.
>>>
>>> Secondly, make sure you lock down all version numbers of dependencies.
>>> It is bad practice to not specify these as it makes your build non-reproducable.
>>> This could also be a reason why it is slow as Maven will need to check periodically to see if new versions are available.
>>> You can use maven enforcer
>>> (http://maven.apache.org/plugins/maven-enforcer-plugin/) to ensure that you have no unversioned artifacts.
>>>
>>> Thirdly, install a Maven Repository Manager (Nexus is one).
>>> This will act as a local proxy and make downloading times much faster.
>>> It also provides an aggregation point, so that there is only one repository to check each artifact for and the Repository Manager will hide checking the other repos MRMs also allow you to do whitelist/blacklist stuff to improve performance.
>>> If you are in a corporate environment you really want an MRM installed.
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>> --
>> 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
>>
>
> ---------------------------------------------------------------------
> 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: How to optimize maven dependencies to get better performance?

Posted by "Wang, Simon" <Yu...@ebay.com>.
I'm using 3.0.3, is this bug related to performance?

~Simon
-----Original Message-----
From: anders.g.hammar@gmail.com [mailto:anders.g.hammar@gmail.com] On Behalf Of Anders Hammar
Sent: 2012年10月11日 14:26
To: Maven Users List; rwheeler@artifact-software.com
Subject: Re: How to optimize maven dependencies to get better performance?

I recall there was an issue with some Aether version and large dependency trees. This had an impact on one (or maybe several) of the Maven 3.0.x versions. But if you're using the latest (3.0.4) it has been fixed. Are you?

/Anders

On Thu, Oct 11, 2012 at 8:07 AM, Ron Wheeler <rw...@artifact-software.com> wrote:
> On 11/10/2012 1:40 AM, Wang, Simon wrote:
>> Hi, Barrie,
>>    That's really helpful!
>>
>>    Even I have local cache, it also takes about 2 mins to resolve dependencies.
> What is it doing during this time. Run maven with a detailed log to 
> see each step.
>
> You might want to break your project up into modules that are smaller 
> and have fewer dependencies in each one.
>
>>    Also it seems maven still will talk with remote maven server even I have local cache.
> It will talk to your Nexus and you need to make sure that your POMs or 
> settings.xml do not refer to any other Maven Repo besides your Nexus.
>>    Yes, maybe it's caused by unspecified version numbers for dependencies.
>>
> Specify your versions on all dependencies
>>    I'll try maven-enforcer-plugin.
> Not sure how this will help with performance.
>>
>>    We're using nexus now, haven't tried MRM, I'll host it and compare it to nexus.
> Nexus is an MRM.
>>
>>    And I saw aether(major in dependency resolving) will take longer time to resolve conflict dependencies.
>>    Is it also a point that need to be improved?
>>    Do you know is there any maven plugin to identify conflict dependencies?
>
> The Eclipse IDE will do this with the m2 Eclipse plug-in. We use STS 
> which is Eclipse fully loaded with everything that you need to use Maven.
>
> This is not likely going to cause a big performance hit.
>> Regards
>> Simon
>>
>> -----Original Message-----
>> From: Barrie Treloar [mailto:baerrach@gmail.com]
>> Sent: 2012年10月11日 11:48
>> To: Maven Users List
>> Subject: Re: How to optimize maven dependencies to get better performance?
>>
>> On Thu, Oct 11, 2012 at 1:46 PM, Wang, Simon <Yu...@ebay.com> wrote:
>>> Hi,
>>>    We're in trouble of terrible performance on resolve maven dependencies.
>>> I did some search about it. Basically below ways should be helpful:
>>>
>>> 1. optimize nexus server to improve response time.
>>> 2. optimize maven dependencies.
>>>   1) avoid duplicated dependencies
>>>   2) avoid dependency conflict cases
>>>   3)....
>>>
>>> Any others suggestions?
>> What specifically is your problem?
>>
>> I can only guess at what you mean.
>> I'm assuming that when you run "mvn install" that maven is reaching out to check for new dependencies which can be time consuming, especially with an empty ~/.m2/repository local cache.
>> After the first install this shouldn't be a problem.
>>
>> Firstly make sure that you do not define additional "repository" in either your settings.xml or pom.xml.
>> Every dependency will be checked against all repositories defined.
>> So just by defining one extra repository will double the time it takes to check dependencies.
>> There is no logic in Maven to blacklist/whitelist what artifacts are located where, this is one reason why you use a Repository Manager.
>> You can see that if you declare repositories in your pom.xml and this is published how it will affect everyone that includes your artifacts.
>> Please don't do that.
>>
>> Secondly, make sure you lock down all version numbers of dependencies.
>> It is bad practice to not specify these as it makes your build non-reproducable.
>> This could also be a reason why it is slow as Maven will need to check periodically to see if new versions are available.
>> You can use maven enforcer
>> (http://maven.apache.org/plugins/maven-enforcer-plugin/) to ensure that you have no unversioned artifacts.
>>
>> Thirdly, install a Maven Repository Manager (Nexus is one).
>> This will act as a local proxy and make downloading times much faster.
>> It also provides an aggregation point, so that there is only one repository to check each artifact for and the Repository Manager will hide checking the other repos MRMs also allow you to do whitelist/blacklist stuff to improve performance.
>> If you are in a corporate environment you really want an MRM installed.
>>
>> ---------------------------------------------------------------------
>> 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
>
>
> --
> 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
>

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


Re: How to optimize maven dependencies to get better performance?

Posted by Anders Hammar <an...@hammar.net>.
I recall there was an issue with some Aether version and large
dependency trees. This had an impact on one (or maybe several) of the
Maven 3.0.x versions. But if you're using the latest (3.0.4) it has
been fixed. Are you?

/Anders

On Thu, Oct 11, 2012 at 8:07 AM, Ron Wheeler
<rw...@artifact-software.com> wrote:
> On 11/10/2012 1:40 AM, Wang, Simon wrote:
>> Hi, Barrie,
>>    That's really helpful!
>>
>>    Even I have local cache, it also takes about 2 mins to resolve dependencies.
> What is it doing during this time. Run maven with a detailed log to see
> each step.
>
> You might want to break your project up into modules that are smaller
> and have fewer dependencies in each one.
>
>>    Also it seems maven still will talk with remote maven server even I have local cache.
> It will talk to your Nexus and you need to make sure that your POMs or
> settings.xml do not refer to any other Maven Repo besides your Nexus.
>>    Yes, maybe it's caused by unspecified version numbers for dependencies.
>>
> Specify your versions on all dependencies
>>    I'll try maven-enforcer-plugin.
> Not sure how this will help with performance.
>>
>>    We're using nexus now, haven't tried MRM, I'll host it and compare it to nexus.
> Nexus is an MRM.
>>
>>    And I saw aether(major in dependency resolving) will take longer time to resolve conflict dependencies.
>>    Is it also a point that need to be improved?
>>    Do you know is there any maven plugin to identify conflict dependencies?
>
> The Eclipse IDE will do this with the m2 Eclipse plug-in. We use STS
> which is Eclipse fully loaded with everything that you need to use Maven.
>
> This is not likely going to cause a big performance hit.
>> Regards
>> Simon
>>
>> -----Original Message-----
>> From: Barrie Treloar [mailto:baerrach@gmail.com]
>> Sent: 2012年10月11日 11:48
>> To: Maven Users List
>> Subject: Re: How to optimize maven dependencies to get better performance?
>>
>> On Thu, Oct 11, 2012 at 1:46 PM, Wang, Simon <Yu...@ebay.com> wrote:
>>> Hi,
>>>    We're in trouble of terrible performance on resolve maven dependencies.
>>> I did some search about it. Basically below ways should be helpful:
>>>
>>> 1. optimize nexus server to improve response time.
>>> 2. optimize maven dependencies.
>>>   1) avoid duplicated dependencies
>>>   2) avoid dependency conflict cases
>>>   3)....
>>>
>>> Any others suggestions?
>> What specifically is your problem?
>>
>> I can only guess at what you mean.
>> I'm assuming that when you run "mvn install" that maven is reaching out to check for new dependencies which can be time consuming, especially with an empty ~/.m2/repository local cache.
>> After the first install this shouldn't be a problem.
>>
>> Firstly make sure that you do not define additional "repository" in either your settings.xml or pom.xml.
>> Every dependency will be checked against all repositories defined.
>> So just by defining one extra repository will double the time it takes to check dependencies.
>> There is no logic in Maven to blacklist/whitelist what artifacts are located where, this is one reason why you use a Repository Manager.
>> You can see that if you declare repositories in your pom.xml and this is published how it will affect everyone that includes your artifacts.
>> Please don't do that.
>>
>> Secondly, make sure you lock down all version numbers of dependencies.
>> It is bad practice to not specify these as it makes your build non-reproducable.
>> This could also be a reason why it is slow as Maven will need to check periodically to see if new versions are available.
>> You can use maven enforcer
>> (http://maven.apache.org/plugins/maven-enforcer-plugin/) to ensure that you have no unversioned artifacts.
>>
>> Thirdly, install a Maven Repository Manager (Nexus is one).
>> This will act as a local proxy and make downloading times much faster.
>> It also provides an aggregation point, so that there is only one repository to check each artifact for and the Repository Manager will hide checking the other repos MRMs also allow you to do whitelist/blacklist stuff to improve performance.
>> If you are in a corporate environment you really want an MRM installed.
>>
>> ---------------------------------------------------------------------
>> 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
>
>
> --
> 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
>

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


Re: How to optimize maven dependencies to get better performance?

Posted by Olivier Lamy <ol...@apache.org>.
2012/10/11 Ron Wheeler <rw...@artifact-software.com>:
> On 11/10/2012 1:40 AM, Wang, Simon wrote:
>> Hi, Barrie,
>>    That's really helpful!
>>
>>    Even I have local cache, it also takes about 2 mins to resolve dependencies.
> What is it doing during this time. Run maven with a detailed log to see
> each step.
>
> You might want to break your project up into modules that are smaller
> and have fewer dependencies in each one.
>
>>    Also it seems maven still will talk with remote maven server even I have local cache.
> It will talk to your Nexus and you need to make sure that your POMs or
> settings.xml do not refer to any other Maven Repo besides your Nexus.
>>    Yes, maybe it's caused by unspecified version numbers for dependencies.
>>
> Specify your versions on all dependencies
>>    I'll try maven-enforcer-plugin.
> Not sure how this will help with performance.
>>
>>    We're using nexus now, haven't tried MRM, I'll host it and compare it to nexus.
> Nexus is an MRM.

Various Maven Repository Managers are listed here:
http://maven.apache.org/repository-management.html
Feel free to test all.
As we are on maven users mailing list, I won't give you my preference
(as it's usually good on such context to be fair ! and let user made
their own experience on the topic).


>>
>>    And I saw aether(major in dependency resolving) will take longer time to resolve conflict dependencies.
>>    Is it also a point that need to be improved?
>>    Do you know is there any maven plugin to identify conflict dependencies?
>
> The Eclipse IDE will do this with the m2 Eclipse plug-in. We use STS
> which is Eclipse fully loaded with everything that you need to use Maven.
>
> This is not likely going to cause a big performance hit.
>> Regards
>> Simon
>>
>> -----Original Message-----
>> From: Barrie Treloar [mailto:baerrach@gmail.com]
>> Sent: 2012年10月11日 11:48
>> To: Maven Users List
>> Subject: Re: How to optimize maven dependencies to get better performance?
>>
>> On Thu, Oct 11, 2012 at 1:46 PM, Wang, Simon <Yu...@ebay.com> wrote:
>>> Hi,
>>>    We're in trouble of terrible performance on resolve maven dependencies.
>>> I did some search about it. Basically below ways should be helpful:
>>>
>>> 1. optimize nexus server to improve response time.
>>> 2. optimize maven dependencies.
>>>   1) avoid duplicated dependencies
>>>   2) avoid dependency conflict cases
>>>   3)....
>>>
>>> Any others suggestions?
>> What specifically is your problem?
>>
>> I can only guess at what you mean.
>> I'm assuming that when you run "mvn install" that maven is reaching out to check for new dependencies which can be time consuming, especially with an empty ~/.m2/repository local cache.
>> After the first install this shouldn't be a problem.
>>
>> Firstly make sure that you do not define additional "repository" in either your settings.xml or pom.xml.
>> Every dependency will be checked against all repositories defined.
>> So just by defining one extra repository will double the time it takes to check dependencies.
>> There is no logic in Maven to blacklist/whitelist what artifacts are located where, this is one reason why you use a Repository Manager.
>> You can see that if you declare repositories in your pom.xml and this is published how it will affect everyone that includes your artifacts.
>> Please don't do that.
>>
>> Secondly, make sure you lock down all version numbers of dependencies.
>> It is bad practice to not specify these as it makes your build non-reproducable.
>> This could also be a reason why it is slow as Maven will need to check periodically to see if new versions are available.
>> You can use maven enforcer
>> (http://maven.apache.org/plugins/maven-enforcer-plugin/) to ensure that you have no unversioned artifacts.
>>
>> Thirdly, install a Maven Repository Manager (Nexus is one).
>> This will act as a local proxy and make downloading times much faster.
>> It also provides an aggregation point, so that there is only one repository to check each artifact for and the Repository Manager will hide checking the other repos MRMs also allow you to do whitelist/blacklist stuff to improve performance.
>> If you are in a corporate environment you really want an MRM installed.
>>
>> ---------------------------------------------------------------------
>> 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
>
>
> --
> 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
>



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

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


Re: How to optimize maven dependencies to get better performance?

Posted by Ron Wheeler <rw...@artifact-software.com>.
On 11/10/2012 1:40 AM, Wang, Simon wrote:
> Hi, Barrie,
>    That's really helpful!
>
>    Even I have local cache, it also takes about 2 mins to resolve dependencies.
What is it doing during this time. Run maven with a detailed log to see
each step.

You might want to break your project up into modules that are smaller
and have fewer dependencies in each one.

>    Also it seems maven still will talk with remote maven server even I have local cache.
It will talk to your Nexus and you need to make sure that your POMs or
settings.xml do not refer to any other Maven Repo besides your Nexus.
>    Yes, maybe it's caused by unspecified version numbers for dependencies.
>    
Specify your versions on all dependencies
>    I'll try maven-enforcer-plugin.
Not sure how this will help with performance.
>
>    We're using nexus now, haven't tried MRM, I'll host it and compare it to nexus.
Nexus is an MRM.
>
>    And I saw aether(major in dependency resolving) will take longer time to resolve conflict dependencies.
>    Is it also a point that need to be improved?
>    Do you know is there any maven plugin to identify conflict dependencies?

The Eclipse IDE will do this with the m2 Eclipse plug-in. We use STS
which is Eclipse fully loaded with everything that you need to use Maven.

This is not likely going to cause a big performance hit.
> Regards
> Simon
>
> -----Original Message-----
> From: Barrie Treloar [mailto:baerrach@gmail.com] 
> Sent: 2012年10月11日 11:48
> To: Maven Users List
> Subject: Re: How to optimize maven dependencies to get better performance?
>
> On Thu, Oct 11, 2012 at 1:46 PM, Wang, Simon <Yu...@ebay.com> wrote:
>> Hi,
>>    We're in trouble of terrible performance on resolve maven dependencies.
>> I did some search about it. Basically below ways should be helpful:
>>
>> 1. optimize nexus server to improve response time.
>> 2. optimize maven dependencies.
>>   1) avoid duplicated dependencies
>>   2) avoid dependency conflict cases
>>   3)....
>>
>> Any others suggestions?
> What specifically is your problem?
>
> I can only guess at what you mean.
> I'm assuming that when you run "mvn install" that maven is reaching out to check for new dependencies which can be time consuming, especially with an empty ~/.m2/repository local cache.
> After the first install this shouldn't be a problem.
>
> Firstly make sure that you do not define additional "repository" in either your settings.xml or pom.xml.
> Every dependency will be checked against all repositories defined.
> So just by defining one extra repository will double the time it takes to check dependencies.
> There is no logic in Maven to blacklist/whitelist what artifacts are located where, this is one reason why you use a Repository Manager.
> You can see that if you declare repositories in your pom.xml and this is published how it will affect everyone that includes your artifacts.
> Please don't do that.
>
> Secondly, make sure you lock down all version numbers of dependencies.
> It is bad practice to not specify these as it makes your build non-reproducable.
> This could also be a reason why it is slow as Maven will need to check periodically to see if new versions are available.
> You can use maven enforcer
> (http://maven.apache.org/plugins/maven-enforcer-plugin/) to ensure that you have no unversioned artifacts.
>
> Thirdly, install a Maven Repository Manager (Nexus is one).
> This will act as a local proxy and make downloading times much faster.
> It also provides an aggregation point, so that there is only one repository to check each artifact for and the Repository Manager will hide checking the other repos MRMs also allow you to do whitelist/blacklist stuff to improve performance.
> If you are in a corporate environment you really want an MRM installed.
>
> ---------------------------------------------------------------------
> 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


-- 
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: How to optimize maven dependencies to get better performance?

Posted by "Wang, Simon" <Yu...@ebay.com>.
Hi, Barrie,
   That's really helpful!

   Even I have local cache, it also takes about 2 mins to resolve dependencies.
   Also it seems maven still will talk with remote maven server even I have local cache.
   Yes, maybe it's caused by unspecified version numbers for dependencies.
   
   I'll try maven-enforcer-plugin.

   We're using nexus now, haven't tried MRM, I'll host it and compare it to nexus.

   And I saw aether(major in dependency resolving) will take longer time to resolve conflict dependencies.
   Is it also a point that need to be improved?
   Do you know is there any maven plugin to identify conflict dependencies?

Regards
Simon

-----Original Message-----
From: Barrie Treloar [mailto:baerrach@gmail.com] 
Sent: 2012年10月11日 11:48
To: Maven Users List
Subject: Re: How to optimize maven dependencies to get better performance?

On Thu, Oct 11, 2012 at 1:46 PM, Wang, Simon <Yu...@ebay.com> wrote:
> Hi,
>    We're in trouble of terrible performance on resolve maven dependencies.
> I did some search about it. Basically below ways should be helpful:
>
> 1. optimize nexus server to improve response time.
> 2. optimize maven dependencies.
>   1) avoid duplicated dependencies
>   2) avoid dependency conflict cases
>   3)....
>
> Any others suggestions?

What specifically is your problem?

I can only guess at what you mean.
I'm assuming that when you run "mvn install" that maven is reaching out to check for new dependencies which can be time consuming, especially with an empty ~/.m2/repository local cache.
After the first install this shouldn't be a problem.

Firstly make sure that you do not define additional "repository" in either your settings.xml or pom.xml.
Every dependency will be checked against all repositories defined.
So just by defining one extra repository will double the time it takes to check dependencies.
There is no logic in Maven to blacklist/whitelist what artifacts are located where, this is one reason why you use a Repository Manager.
You can see that if you declare repositories in your pom.xml and this is published how it will affect everyone that includes your artifacts.
Please don't do that.

Secondly, make sure you lock down all version numbers of dependencies.
It is bad practice to not specify these as it makes your build non-reproducable.
This could also be a reason why it is slow as Maven will need to check periodically to see if new versions are available.
You can use maven enforcer
(http://maven.apache.org/plugins/maven-enforcer-plugin/) to ensure that you have no unversioned artifacts.

Thirdly, install a Maven Repository Manager (Nexus is one).
This will act as a local proxy and make downloading times much faster.
It also provides an aggregation point, so that there is only one repository to check each artifact for and the Repository Manager will hide checking the other repos MRMs also allow you to do whitelist/blacklist stuff to improve performance.
If you are in a corporate environment you really want an MRM installed.

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


Re: How to optimize maven dependencies to get better performance?

Posted by Barrie Treloar <ba...@gmail.com>.
On Thu, Oct 11, 2012 at 1:46 PM, Wang, Simon <Yu...@ebay.com> wrote:
> Hi,
>    We're in trouble of terrible performance on resolve maven dependencies.
> I did some search about it. Basically below ways should be helpful:
>
> 1. optimize nexus server to improve response time.
> 2. optimize maven dependencies.
>   1) avoid duplicated dependencies
>   2) avoid dependency conflict cases
>   3)....
>
> Any others suggestions?

What specifically is your problem?

I can only guess at what you mean.
I'm assuming that when you run "mvn install" that maven is reaching
out to check for new dependencies which can be time consuming,
especially with an empty ~/.m2/repository local cache.
After the first install this shouldn't be a problem.

Firstly make sure that you do not define additional "repository" in
either your settings.xml or pom.xml.
Every dependency will be checked against all repositories defined.
So just by defining one extra repository will double the time it takes
to check dependencies.
There is no logic in Maven to blacklist/whitelist what artifacts are
located where, this is one reason why you use a Repository Manager.
You can see that if you declare repositories in your pom.xml and this
is published how it will affect everyone that includes your artifacts.
Please don't do that.

Secondly, make sure you lock down all version numbers of dependencies.
It is bad practice to not specify these as it makes your build non-reproducable.
This could also be a reason why it is slow as Maven will need to check
periodically to see if new versions are available.
You can use maven enforcer
(http://maven.apache.org/plugins/maven-enforcer-plugin/) to ensure
that you have no unversioned artifacts.

Thirdly, install a Maven Repository Manager (Nexus is one).
This will act as a local proxy and make downloading times much faster.
It also provides an aggregation point, so that there is only one
repository to check each artifact for and the Repository Manager will
hide checking the other repos
MRMs also allow you to do whitelist/blacklist stuff to improve performance.
If you are in a corporate environment you really want an MRM installed.

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


RE: How to optimize maven dependencies to get better performance?

Posted by "Wang, Simon" <Yu...@ebay.com>.
Thanks Jesse. I'll try that.

Regards
Simon
-----Original Message-----
From: Jesse Farinacci [mailto:jieryn@gmail.com] 
Sent: 2012年10月11日 11:47
To: Maven Users List
Subject: Re: How to optimize maven dependencies to get better performance?

Greetings,

On Wed, Oct 10, 2012 at 11:16 PM, Wang, Simon <Yu...@ebay.com> wrote:
>    We're in trouble of terrible performance on resolve maven dependencies.
> Any others suggestions?

No -SNAPSHOT dependencies not in the reactor.
No version range dependencies.
No -U mvn invocation.
One single {repositories,pluginRepositories}/repository defined at each project's top level pom.xml, i.e. your own MRM At your own MRM, proper ordering of repository search priority At your own MRM, proper white/black listing

There are only a couple more ways to squeeze out performance. Let me know when you've verified all that, -Jesse

--
There are 10 types of people in this world, those that can read binary and those that can not.

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


Re: How to optimize maven dependencies to get better performance?

Posted by Jesse Farinacci <ji...@gmail.com>.
Greetings,

On Wed, Oct 10, 2012 at 11:16 PM, Wang, Simon <Yu...@ebay.com> wrote:
>    We're in trouble of terrible performance on resolve maven dependencies.
> Any others suggestions?

No -SNAPSHOT dependencies not in the reactor.
No version range dependencies.
No -U mvn invocation.
One single {repositories,pluginRepositories}/repository defined at
each project's top level pom.xml, i.e. your own MRM
At your own MRM, proper ordering of repository search priority
At your own MRM, proper white/black listing

There are only a couple more ways to squeeze out performance. Let me
know when you've verified all that,
-Jesse

-- 
There are 10 types of people in this world, those
that can read binary and those that can not.

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