-
Notifications
You must be signed in to change notification settings - Fork 27
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
SpdxListedLicenseException when the internet is not available #172
Comments
Short answer is yes - that functionality is already built in. From the above error message, it looks like it is falling back to using the locally cached licenses, just after displaying a rather ugly error message. The SPDX Java Library support system environment variables to control whether to attempt going out to the internet or not. See https://github.com/spdx/spdx-java-library?tab=readme-ov-file#configuration-options @garydgregory Let me know if this solves the issue. We couple probably better document and/or provide a more convenient configuration mechanism in the Maven plugin. Let me know if you have any thoughts on this. |
Thank you for the answer. The docs look good. Since not having internet access is rare, I might leave it as is but... the large error message due to the stack trace is alarming in the sense that I am left not knowing (without your explanation and reading the docs) what it is the plugin actually did. I think this is really now a request for the plugin to catch this error and log a helpful message to the console such that Maven users are left with an actionable item: "this happened because of that, if you want the internet behavior x, see the docs here" kind of message. Ty! |
Changes the logging level from error to warn if the license list can not be accessed over the network. The logic being that the impact is not substantial since you may only be referencing a stale version of the license list rather than the most recent. The warning message was also enhanced to point to the useJARLicenseInfoOnly property. Reference related issue spdx/spdx-maven-plugin#172
It looks like the latest SPDX Java library already excludes the stack trace from the logging message. It still, however, will log this as an error rather than a warning. Perhaps it should be a warning rather than an error since the impact is it will use a possibly stale version of the license list. I created a PR to change the error to warning. |
Changes the logging level from error to warn if the license list can not be accessed over the network. The logic being that the impact is not substantial since you may only be referencing a stale version of the license list rather than the most recent. The warning message was also enhanced to point to the useJARLicenseInfoOnly property. Reference related issue spdx/spdx-maven-plugin#172
Hi All,
Would it be possible for the plugin to deliver known licenses in its jar and only go to the internet if absolutely required?
Without internet access you get:
The text was updated successfully, but these errors were encountered: