-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Maven 3.9.x to download dependency POMs in parallel #1169
Comments
@Eskibear you can use maven 4 already if you run a maven build, just add it as a maven installation and choose that as the default in the m2eclipse settings. For m2eclipse embedded runtime, this is nothing we plan for the near future unless maven4 is final released, there is a major adoption of maven4 or there is sustainable contribution in form of development efforts and/or funding. If this is crucial to your business and you likes to speed up the development of m2e in general a sponsoring would allow me to assign more time-slots to bug fixing or contact me for an individual contract for this specific issue. |
Thank you for the information. I am working on eclipse.jdt.ls project, which uses m2e to import Maven projects for users. We've received complaints about the startup performance, especially when they open Maven projects for the first time. I have been seeking ways to improve that for a while, and that's why I'm so eager to early investigate the possibility that m2e adopts upstream improvement in maven-resolver, at this stage. Appreciate for your help! I'm also willing to contribute some effort if there's anything I can help to speed it up. I believe it would benefit a lot of users. |
Its always hard to guess what/if it could be improved, for that purpose we have opened: but it has not gotten much feedback yet.
If the resolver part is that really improves things (I really doubt that first time performance is really something that will be a valuable thing to put effort in as usually one has to fill the maven cache only once), I think it would be better to integrate this into maven 3.9.x line as well m2e uses the maven resolver to fetch dependencies so it will then "just work" with minimal impact for m2e.
I think an important part would be:
If only a few percent of these users would contribute to the tools they use I think this would speed up things dramatically... |
Agree. It would be great if maven-resolver-1.9.2 can be integrated into 3.9.x line, but I see maven-3.8.7 (released on 2022-12-25) is still using maven-resolver-1.6.3. I'm concerning whether maven-resolver 1.9.2 is depending on some new architecture in maven-4.x. |
3.8.x is jsut maintain release, but 3.9.x is the next release line for new features. |
this is the PR and this the List of todos fpr 3.9.0 release |
Maven 3.9.0 has been released, with maven-resolver 1.9.4. I tested the performance boost today, running Results:
I'll try creating a PR bumping maven-runtime to 3.9.0. |
As mentioned above we can't ugrade to 4.x or 3.9.x if not most of plugins have adopted to it 3.9 already contains some breaking changes, as I know there is some chance for a 3.8.8 release you probably want to help backporting the maven-resolver 1.9.4 to 3.8.x as well. |
@Eskibear by the way if you like to hack m2e a bit yourself and found that especially the resolving of dependencies is slow I recently came into my mind that m2e probably don't need to use "maven" but can use resolver directly, that way we can do whatever fits (and probably even show nice progress bars), here are some pointers: m2e-core/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java Lines 103 to 104 in 2ca5d4b
This is where we compute the classpath, it would be good for a first step to not use If this works, we then can head over to Lines 843 to 860 in 0b49dca
where currently we ask maven to resolve the dependencies of the project, but here we can just call resolver (or whatever other technique) directly and then set this in the model (for backward compat + direct maven usage). |
Thank you for pointing above out, which helps me to get more familiar with the repo. For consistency, hacking m2e with different impl from maven-resolver is the last thing I would resort to. Integrating the latest maven-resolver is my first choice for the moment. It would keep as same behavior with Maven CLI as possible, and reduce potential maintenance effort in the future (maybe). The tradeoff is that we will always have to wait upstream updates for new features/fixes, and limitation for further customization (like nice progress bars you mentioned)... |
@Eskibear I think we should share the feedback to Maven and encourage them to make BF as the default option. |
Since #1238 is merged, can this be closed? |
I tried snapshots from Jenkins CI for #1238 a few days ago, and it worked as expected. I've also created a PR in downstream jdt.ls project to consume it, let's close this issue. |
Maven 4.0.0-alpha-3 has been released.
One of the significant improvements is downloading poms in parallel, which has been shipped with maven-resolver-1.9.2, included in maven-4.0.0-alpha-3. It largely improves the performance when local maven repository is empty (common case for a new machine).
I tested with a simple spring-boot project, running
mvn clean install
with an empty local repository, ~85MB dependencies were downloaded and below are the time costs for different configs:mvn 4.0.0-alpha-3
mvn 3.8.6
You can download and try from: https://dlcdn.apache.org/maven/maven-4/4.0.0-alpha-3/binaries/
Add
-Daether.dependencyCollector.impl=bf
to enable parallel downloading.The text was updated successfully, but these errors were encountered: