Issue Details (XML | Word | Printable)

Key: MNG-3222
Type: Bug Bug
Status: Reopened Reopened
Priority: Major Major
Assignee: Unassigned
Reporter: Stefan Behnel
Votes: 1
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Maven 2

Compile dependency resolution is slow

Created: 25/Sep/07 08:40 AM   Updated: 17/Oct/08 06:54 PM
Component/s: Dependencies
Affects Version/s: 2.0.4
Fix Version/s: 2.2.x

Time Tracking:
Not Specified


 Description  « Hide
Compile dependency resolution is slow. I just wrote an empty module (only test sources that were not compiled), and it took Maven more than five minutes to build it, without any compilation/generation/testing/whatsoever. I just took literally minutes to resolve a couple of hundred compile time dependencies for the compiler plugin, which was then executed twice.

To me, this sounds like a problem with the algorithmic complexity of the dependency resolution.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Brett Porter added a comment - 29/Oct/07 07:44 PM
please provide the sample project and anything relevant from settings.xml

Stefan Behnel added a comment - 30/Oct/07 02:13 AM
Since the report, it has become clear that the problem is the number of snapshots our repository server stores. The number of snapshots in the local repository does not seem to have a major impact. We found this by accident as increasing the version number of our software cut the build time from about 4 hours down to 40 minutes.

I think some repository caching would really help here.


Stefan Behnel added a comment - 30/Oct/07 02:13 AM
This is an issue.

Brett Porter added a comment - 30/Oct/07 02:19 AM
this is entirely controllable by configuration
  • you can configure <repository> definitions to check for snapshot updates less frequently, or not at all (ie, on demand)
  • if the problem is external network traffic, installation of a repository manager (eg Archiva, Artifactory, Proximity) will assist

let us know how this goes as to whether this issue can be re-closed - if it is network traffic configuration is the only thing that will help. If it is cpu time in calculating the dependencies then it is an issue, but more details will be needed.


Stefan Behnel added a comment - 30/Oct/07 03:18 AM
We are using an in-house repository server via HTTP. It pings in less than 4ms, so I don't think latency is an issue here. For the last version, we have about 200 snapshots lying around per module. That makes some 700-1000 files per module. Serving a directory listing for them shouldn't be a problem for a web server (especially since I would expect the whole directory tree to be cached in RAM pretty soon), so I wouldn't expect the problem to be on the server side.

Our modules have up to 250 transitive dependencies, while I would expect the average to be much lower. So let's say we have some 100 directory listings per module. A listing page is between 70K and 130K and wget retrieves it in less than 0.3 seconds. That would make it at most 30 seconds for the listings or about one minute if we count 250 dependencies. Compile time resolution takes about 3 minutes in total for 250 dependencies, that means we are already coming somewhat close to the times we see here, iff we really access the server. It doesn't explain the remaining difference of 2/3 of the time, though. BTW, keeping the HTTP connection open during the build (possibly only for directory listings) would likely drop the access time quite a bit, I don't know if Maven does this.

However, snapshot resolution happens once per day by default. But even if I re-run the build multiple times, I do not see that the times drop by a major extent. So I'm still convinced that the problem is not external to Maven.


Mark Crocker added a comment - 17/Oct/08 06:54 PM
A posting on Nabble suggested using:

<dependencyLocationsEnabled>false</dependencyLocationsEnabled>

as a work-around.

See: http://www.nabble.com/Dependency-Report-Taking-Forever-And-A-Day-td19416718.html