Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] performance: creation of DependencyNode, DefaultArtifact and Dependency

Martin Koci wrote:

Can you detail all chains of objects/fields holding the artifact instances?

The holding structure is
[...]
org.apache.maven.project.MavenProject ->
org.sonatype.aether.util.DefaultRepositorySystemSession ->
org.sonatype.aether.graph.Dependency

Am I right to assume that the omitted part of the chain is

MavenProject.projectBuilderConfiguration
-> DefaultRepositorySystemSession.cache
?

If so, I suggest to have m2e reset/clear the cache once dependency resolution is done or otherwise use a size-restricted cache impl.

Sorry, it's really chaotic. Let's have Dependecy A. Then:
project B: depends on A
project C: depends on B and A

As result, Project C has dependency A twice: 1) direct dependency 2)
transitive dependency from B. When I remove the direct dependency, will
be resolution faster?

Potentially, it depends on whether the paths leading to A employ the same remote repositories, dependency management etc. If all factors that could affect the transitive dependencies of A are equal, the sub graph rooted at A is shared and not build again.

Note however, that removing a direct dependency when a project actually uses its code, is conceptually wrong. The better approach would rather be to exclude the transitive dependency if you really want to go down that path.

Theoreticaly, when we minimize dependencyManagement section, will be
resolution faster?

Theoretically, yes. dependencyManagement translates into some HashMap's that get consulted for each dependency to see whether its version or scope are managed and the dependency object needs to get updated. However, whether this processing has actually significant contribution to your case or not is something I can't tell. From what you said earlier, it seems conflict resolution is the biggest CPU task.


Benjamin


Back to the top