Skip to content
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

update-properties takes a lot of time for some projects #1076

Open
ljackiewicz opened this issue May 10, 2024 · 4 comments
Open

update-properties takes a lot of time for some projects #1076

ljackiewicz opened this issue May 10, 2024 · 4 comments

Comments

@ljackiewicz
Copy link

I wonder if it's intentional when calling update-properties to check the metadata of all defined dependencies if we pass includesList which will end up skipping version updates for most of them?

I invoke something like this:
mvn org.codehaus.mojo:versions-maven-plugin:2.16.2:update-properties -DallowMinorUpdates=false -Dincludes=my.groupId.*,my.other.groupId.*

And for some projects it takes even about 30 minutes to finally update only a few of my own dependencies among the multitude of third-party dependencies that I do not want to update automatically.

@slawekjaranowski
Copy link
Member

Which Maven version do you use?

@slawekjaranowski
Copy link
Member

A debug log (mvn ... -X) can help to investigate which task take the most time

@ljackiewicz
Copy link
Author

I'm using Maven version 3.8.8, but I also tested it on version 3.9.1.

The most time-consuming task is to download maven-metadata.xml files. I download them, like all defined dependencies, through my own Nexus server.
Downloading the dependencies itself does not take that much time, but maybe the slow download of maven-metadata.xml files is due to the fact that it is a less frequent operation and the next time the versions plugin is invoked, these files are no longer stored in the Nexus cache.

However, when calling update-properties it seems that maven-metadata.xml files are downloaded for all defined dependencies, not just those defined by includesList.

@slawekjaranowski
Copy link
Member

In method: org.codehaus.mojo.versions.api.DefaultVersionsHelper#getVersionPropertiesMap we only skip properties by property name.

we have a code:

            Dependency[] dependencies = property.getDependencies();
            if (dependencies != null) {
                for (Dependency dependency : dependencies) {
                    getLog().debug("Property ${" + property.getName() + "}: Adding association to " + dependency);
                    builder.withAssociation(this.createDependencyArtifact(dependency), false);
                }
            }

where dependencies are not filtered, and next method org.codehaus.mojo.versions.api.PropertyVersionsBuilder#build cause to resolve version for all artifacts.

Finally in method org.codehaus.mojo.versions.UpdatePropertiesMojoBase#update artifact are filtered and update only what is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants