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

Fix fingerprint with deps #1074

Merged
merged 4 commits into from
Jan 10, 2022
Merged

Conversation

tisoft
Copy link
Contributor

@tisoft tisoft commented Jan 7, 2022

Newer Maven versions (at least 3.6.3 is affected) use a org.apache.maven.model.merge.ModelMerger$MergingList, if a plugin is defined inside pluginManagement and additionally defines custom dependencies. This class is not serializable, which will fail the PluginFingerprint.

This change replaces the dependency list with an ArrayList before serialization and sets it back to the original list afterwards.

You can try the demonstrator test without the fix commit, to validate the error.

Fixes: #1073

@nedtwigg nedtwigg requested a review from lutovich January 7, 2022 18:22
@lutovich
Copy link
Contributor

lutovich commented Jan 8, 2022

Thanks for this fix! I will review it today or tomorrow. Tbh, this error is unexpected because org.apache.maven.model.Plugin implements Serializable. Perhaps this is a bug in the newer Maven version?

Copy link
Contributor

@lutovich lutovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I added two comments. Thanks for discovering and fixing this problem!

I also created a Jira for Maven https://issues.apache.org/jira/browse/MNG-7386.

@lutovich lutovich merged commit eba1c59 into diffplug:main Jan 10, 2022
@nedtwigg
Copy link
Member

Published in 2.19.2.

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

Successfully merging this pull request may close these issues.

java.io.NotSerializableException with upToDateChecking enabled
3 participants