-
Notifications
You must be signed in to change notification settings - Fork 128
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
Allow providing local license texts from a relative path for aggregate-download-licenses #428
Comments
It is now working in combination with the Maven resource plugin. Back to the problem I had: We want to check-in old licenses not available on the web anymore in our GIT repository of the Maven multi module project. It should reside just there with the source code. Problem: not documented file:// descriptor for element inside is working but allows only absolute paths. Problem: We don't want to check-in absolute paths into our GIT repository as this changes dependend where the user clones out the repo on his machine. So.... My file structure in the git repository now: Root dir of maven multi module project: has subfolder /LICENSES/configuration/template which contains the previously on the first mvn clean package execution) generated (now renamed to licenses-missing-configuration.xml). It will be the base for the (see documentation, by populating it manually with all missing licenses and paths to the license texts. In this file we can also use Maven properties to make it now support relative paths to the license texts.
This file is then copied by the Maven resource plugin in an earlier lifecycle phase than the Maven license plugin to Parent pom,xml:
|
The goal download-licenses/aggregate-download-licenses currently does not support using locally provided license text files. We have dependencies which are that old or are proprietary so that there isn't any license file available online.
Actually it does, using the "file://" descriptor in the licensesConfigFile's "URL" element:
https://github.com/mojohaus/license-maven-plugin/blob/master/src/main/java/org/codehaus/mojo/license/download/LicenseDownloader.java#L181
(This is not documented)
But scanning the URL value for a "file://" descriptor does not make it support a relative local URI using the working directory like "./LICENSES/abc.license". Using file://./LICENSE/abc.license" will produce a Java URI exception: Caused by: java.lang.IllegalArgumentException: URI authority component has undefined host
It only supports absolute paths.
Of course, I could also use the "aggregate-add-third-party" goal, but this does not offer as many options as "aggregate-download-licenses" does and I also want to collect all the licenses (whether downloaded from the Web or provided locally) in one folder.
Any suggestions / workarounds how to solve this?
The text was updated successfully, but these errors were encountered: