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

2012-11-09 Thread Wang, Simon
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:bri...@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 yunfeng.w...@ebay.com wrote:

 Hi, Barrie,
Ask a stupid question about enforcer plugin.
 I added enforcer plugin into project pom like this:
 plugin

 groupIdorg.apache.maven.plugins/groupId

 artifactIdmaven-enforcer-plugin/artifactId
 version1.1.1/version
 executions
   execution
 idenforce/id
 configuration
 rules

 DependencyConvergence/
 /rules
 /configuration
 goals
   goalenforce/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[pluginorg.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.w...@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:baerr...@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 yunfeng.w...@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

RE: Specify enforcer:enforce rules from command line

2012-10-24 Thread Wang, Simon
I specified rule in pom.xml, after run mvn enforcer:enforce, still complain 
no rules set.
Really don't know what happened.

Regards
Simon
-Original Message-
From: Arnaud bourree [mailto:arnaud.bour...@gmail.com] 
Sent: 2012年10月24日 22:18
To: Maven Users List
Subject: Re: Specify enforcer:enforce rules from command line

I create issue MENFORCER-142

I found a partial work-around: running mvn enforcer:enforce fail if there is no 
rules set :-/

But that not enough for me.

Regards,

Arnaud.


2012/10/23 Anders Hammar and...@hammar.net:
 Don't think it's possible. The enforcer plugin is meant to be bound to 
 the build lifecycle so it should be configured in the pom. But I guess 
 an enhancement ticket with a patch could change that? :-)

 /Anders

 On Tue, Oct 23, 2012 at 5:50 PM, Arnaud bourree 
 arnaud.bour...@gmail.com wrote:
 Hello,

 How could we specify enforcer:enforce rules from command line?

 I want to run command line like following without updating any pom.xml:
 mvn enforcer:enforce -Drules=com.acme.UseAcmeParentPom

 The goal of this enforcer:enforce rule is to check that Acme's 
 developers write pom.xml which inherit from acme's parent pom.xml And 
 because they may not inherit from acme's parent pom.xml, I cannot 
 specify enforcer rule in.

 Regards,

 Arnaud.

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


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


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



mvn dependency:analyze failed:Invalid signature file digest for Manifest main attributes

2012-10-16 Thread Wang, Simon
Hi,
   I'm trying to analyze my dependencies, but encountered Invalid signature 
file digest for Manifest main attributes issue.
I know it should be caused by signed jar is changed.
   But you know there are lot of dependency jars there. Is there a tool to 
identify which signed jar is changed?

Error log is here:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:
2.1:analyze (default-cli) on project XXX: Execution default-cli of goal 
org.apache.maven.plugins:maven-dependency-plugin:2.1:analyze failed: Invalid 
signature file digest for Manifest main attributes - [Help 1]

Regards
Simon


RE: mvn dependency:analyze failed:Invalid signature file digest for Manifest main attributes

2012-10-16 Thread Wang, Simon
Yes, you're right, but there are lots of dependency jars.

Do you know whether there is a tool(maven plugin) to identify those signed 
changed jars?

Regards
Simon
-Original Message-
From: Martin Gainty [mailto:mgai...@hotmail.com] 
Sent: 2012年10月17日 10:41
To: users@maven.apache.org
Subject: RE: mvn dependency:analyze failed:Invalid signature file digest for 
Manifest main attributes


the manifest.mf contains a MD5-Digest which looks like
Manifest-Version: 1.0

Name: bibparse-1.04/META-INF/MANIFEST.MF
Digest-Algorithms: SHA MD5 
SHA-Digest: +ZeuKiF1Qrq/ym6omfGMSD5tel0=
MD5-Digest: uK1nT2MOzIU5HgaZzmZgHg==where the digest contained in MD-5 does not 
conform to the actual generated MD5 *for the jar *

Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité


Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.


 From: yunfeng.w...@ebay.com
 To: users@maven.apache.org
 Subject: mvn dependency:analyze failed:Invalid signature file digest for 
 Manifest main attributes
 Date: Wed, 17 Oct 2012 01:38:56 +
 
 Hi,
I'm trying to analyze my dependencies, but encountered Invalid signature 
 file digest for Manifest main attributes issue.
 I know it should be caused by signed jar is changed.
But you know there are lot of dependency jars there. Is there a tool to 
 identify which signed jar is changed?
 
 Error log is here:
 [ERROR] Failed to execute goal 
 org.apache.maven.plugins:maven-dependency-plugin:
 2.1:analyze (default-cli) on project XXX: Execution default-cli of goal 
 org.apache.maven.plugins:maven-dependency-plugin:2.1:analyze failed: Invalid 
 signature file digest for Manifest main attributes - [Help 1]
 
 Regards
 Simon
  


RE: mvn dependency:analyze failed:Invalid signature file digest for Manifest main attributes

2012-10-16 Thread Wang, Simon
Yes, I did.

It should be caused by that signed jars are changed.
But my question is whether there is a tool to identify which signed jars are 
changed?

Regards
Simon

Here is stack trace:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:
2.1:analyze (default-cli) on project CoreAppFramework: Execution default-cli of
goal org.apache.maven.plugins:maven-dependency-plugin:2.1:analyze failed: Invali
d signature file digest for Manifest main attributes - [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.apache.maven.plugins:maven-dependency-plugin:2.1:analyze (default-cli) on pro
ject CoreAppFramework: Execution default-cli of goal org.apache.maven.plugins:ma
ven-dependency-plugin:2.1:analyze failed: Invalid signature file digest for Mani
fest main attributes
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:225)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-c
li of goal org.apache.maven.plugins:maven-dependency-plugin:2.1:analyze failed:
Invalid signature file digest for Manifest main attributes
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:110)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:209)
... 19 more
Caused by: java.lang.SecurityException: Invalid signature file digest for Manife
st main attributes
at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVeri
fier.java:241)
at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier
.java:196)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:266)
at java.util.jar.JarVerifier.update(JarVerifier.java:220)
at java.util.jar.JarInputStream.read(JarInputStream.java:193)
at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:111)
at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:89)
at java.util.jar.JarInputStream.getNextEntry(JarInputStream.java:129)
at java.util.jar.JarInputStream.getNextJarEntry(JarInputStream.java:160)

at org.apache.maven.shared.dependency.analyzer.ClassFileVisitorUtils.acc
eptJar(ClassFileVisitorUtils.java:99)
at org.apache.maven.shared.dependency.analyzer.ClassFileVisitorUtils.acc
ept(ClassFileVisitorUtils.java:60)
at org.apache.maven.shared.dependency.analyzer.DefaultClassAnalyzer.anal
yze(DefaultClassAnalyzer.java:46)
at org.apache.maven.shared.dependency.analyzer.DefaultProjectDependencyA
nalyzer.buildArtifactClassMap(DefaultProjectDependencyAnalyzer.java:153)
at org.apache.maven.shared.dependency.analyzer.DefaultProjectDependencyA
nalyzer.analyze(DefaultProjectDependencyAnalyzer.java:72)
at org.apache.maven.plugin.dependency.AbstractAnalyzeMojo.checkDependenc
ies(AbstractAnalyzeMojo.java:168)
at org.apache.maven.plugin.dependency.AbstractAnalyzeMojo.execute(Abstra
ctAnalyzeMojo.java:152)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:101)
... 20 more

-Original Message-
From: Wayne Fay [mailto:wayne...@gmail.com] 
Sent: 2012年10月17日 12:00
To: Maven Users List
Subject: Re: mvn dependency:analyze 

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

2012-10-11 Thread Wang, Simon
I'm using 3.0.3, is this bug related to performance?

~Simon
-Original Message-
From: anders.g.ham...@gmail.com [mailto:anders.g.ham...@gmail.com] On Behalf Of 
Anders Hammar
Sent: 2012年10月11日 14:26
To: Maven Users List; rwhee...@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 rwhee...@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:baerr...@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 yunfeng.w...@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-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org


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


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

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

2012-10-11 Thread Wang, Simon
Hi, Barrie,
   Ask a stupid question about enforcer plugin.
I added enforcer plugin into project pom like this:
plugin

groupIdorg.apache.maven.plugins/groupId

artifactIdmaven-enforcer-plugin/artifactId
version1.1.1/version
executions
  execution
idenforce/id
configuration
rules

DependencyConvergence/
/rules
/configuration
goals
  goalenforce/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[pluginorg.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.w...@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:baerr...@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 yunfeng.w...@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

How to optimize maven dependencies to get better performance?

2012-10-10 Thread Wang, Simon
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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



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

2012-10-10 Thread Wang, Simon
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:baerr...@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 yunfeng.w...@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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



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

2012-10-10 Thread Wang, Simon
Thanks Jesse. I'll try that.

Regards
Simon
-Original Message-
From: Jesse Farinacci [mailto:jie...@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 yunfeng.w...@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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org