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 #358, #352 NPE on site generation caused by null returned by deprecated MavenProject.getDependencyArtifacts() #373

Conversation

tomred-net
Copy link
Contributor

This fix resolves the NPE by adding a check for the null and replacing with an empty set in the case where the deprecated MavenProject.getDependencyArtifacts() returns null.

It should be noted that this PR does not resolve the fact that MavenProject.getDependencyArtifacts() is deprecated. This PR also does not suggest an alternative source of non-transitive dependencies.

This PR puts in a check and returns the code and accompanying test case to a runnable state. Unfortunately many artifact related method on MavenProject are now deprecated but without reference to an alternative source of functionality offered.

…precated MavenProject.getDependencyArtifacts()
…precated MavenProject.getDependencyArtifacts()
@tchemit
Copy link
Contributor

tchemit commented Apr 28, 2021

@tomred-net hi, sound a nice patch. But i can't accept it like this, the format of files has changed, and should not. thanks

@mistic100
Copy link

mistic100 commented Nov 19, 2021

@tomred-net can you make the change requested by @tchemit ?
looking forward for a fix of this huge issue, thanks

@tomred-net
Copy link
Contributor Author

@mistic100 happy to make the change but I can't see what format has changed beyond the changes required for the bug fix. @tchemit can you be specific about what formatting you are unhappy with?

@tomred-net
Copy link
Contributor Author

@mistic100 @tchemit I have tabbed a couple of lines to make it look like it did before. Let me know if there is anything else you would like updated.

@slawekjaranowski
Copy link
Member

files mode was changed 100644 → 100755

…-generation-fork

# Conflicts:
#	src/main/java/org/codehaus/mojo/license/AbstractThirdPartyReportMojo.java
#	src/main/java/org/codehaus/mojo/license/AddThirdPartyMojo.java
#	src/main/java/org/codehaus/mojo/license/AggregateDownloadLicensesMojo.java
#	src/main/java/org/codehaus/mojo/license/DownloadLicensesMojo.java
#	src/main/java/org/codehaus/mojo/license/LicensesXmlInsertVersionsMojo.java
#	src/main/java/org/codehaus/mojo/license/utils/MojoHelper.java
This was linked to issues Jul 3, 2023
@slawekjaranowski slawekjaranowski changed the title Fix #358 NPE on site generation caused by null returned by deprecated MavenProject.getDependencyArtifacts() Fix #358, #352 NPE on site generation caused by null returned by deprecated MavenProject.getDependencyArtifacts() Jul 3, 2023
@slawekjaranowski slawekjaranowski merged commit c154f0f into mojohaus:master Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NPE on site generation NPE in aggregate-third-party-report
5 participants