-
Notifications
You must be signed in to change notification settings - Fork 126
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
NullPointerException in DefaultThirdPartyTool#getProjectsWithNoLicense(...) after upgrade from 2.1.0 to 2.2.0 #508
Comments
Can you provide a simple project which reproduce issue. Something like in https://github.com/mojohaus/license-maven-plugin/tree/master/src/it |
Tried fiddling around to produce a minimal reproducer but failed to build one. It seems, that it is bit tricky to reproduce. From which leaves the For completeness, I added the full plugin config in the entry post. I will try building an IT for it, if I find some more time this week. |
It can be my fault ... 😄 |
Did some more debugging :-) A workaround would be to use The skip condition is meet due to the following change from long buildTimestamp = getBuildTimestamp();
LOG.debug( "Build start at: {}", buildTimestamp );
LOG.debug( "third-party file: {}", thirdPartyFile.lastModified() );
doGenerate = force || !thirdPartyFile.exists() || buildTimestamp > thirdPartyFile.lastModified();
to File projectFile = project.getFile() != null ? project.getFile() : new File("");
LOG.debug( "project file: {} last modified: {}", projectFile, projectFile.lastModified() );
LOG.debug( "third-party file: {} last modified: {}", thirdPartyFile, thirdPartyFile.lastModified() );
doGenerate = force || !thirdPartyFile.exists() || projectFile.lastModified() > thirdPartyFile.lastModified();
In the 2nd execution, I guess, that this was an optimization to avoid regeneration if the actual project file wasn't modified? |
There is some magic in code ... in aggregate goal method There is By the way I still can not reproduce even execute many times .... I will prepare a fix. |
I am able to reproduce it in GitHub actions via https://github.com/rzo1/license-maven-plugin-508 in https://github.com/rzo1/license-maven-plugin-508/actions/runs/5461908479/jobs/9940529031 (not in an IT, was trying it in https://github.com/rzo1/license-maven-plugin/commits/master) |
I have created branch with your examples: https://github.com/mojohaus/license-maven-plugin/commits/issue-508 any idea? |
@slawekjaranowski Yeah, I didn't get the IT failing either :/ The setup is basically similar to https://github.com/rzo1/license-maven-plugin-508 - the only real difference is the pre-existing Therefore, I guess, that the pre-existing file plays a role. For testing, I added it to the IT with similar results: IT passes :/ |
@rzo1 - I have a reproduce 😄 |
Thanks @slawekjaranowski ! |
Hi,
we are trying to upgrade from
2.1.0
to2.2.0
in our project.Currently, we use
in a CI env with a config as follows
and
This works fine with 2.1.0 but now fails with a NullPointerException in 2.2.0:
Obviously, after looking into the code it seems that
licenseMap
isNULL
.Any idea what I am missing here or anything we are doing wrong in the related config?
Thanks in advance!
The text was updated successfully, but these errors were encountered: