mojohaus / license-maven-plugin

Maven plugin to download and collect license files from project dependencies.
https://www.mojohaus.org/license-maven-plugin/
GNU Lesser General Public License v3.0
107 stars 127 forks source link

aggregate-add-third-party does not use missingFileUrl parameter #277

Closed elballa closed 5 years ago

elballa commented 5 years ago

Even though missingFileUrl is set and resolves missing license of a bundle project's dependency, the aggregate-add-third-party goal fails checking for license of that dependency. I'll show you in an integration test

ppalaga commented 5 years ago

You may want to check https://github.com/mojohaus/license-maven-plugin/pull/246

elballa commented 5 years ago

Yes sure, the effect is the same but solution a little bit different

nfalco79 commented 5 years ago

@ppalaga My colleague has open a new defect instead reopen the other one for mistake. He found the cause of the issue. The aggregate-add-third-party goal ignores missingFileUrl parameter if it is the only missing parameter specified. There is a condition in AbstractAddThirdPartyMojo#resolveUnsafeDependenciesFromFile method that check if the missingFile exists and is not empty. If file (src/license/THIRD-PARTY.txt) exists and is not empty then he analyses missingFileUrl content otherwise this is ignored (and this is the bug). The content of missingFileUrl should be taken into account and merged regardless of whether that file (src/license/THIRD-PARTY.txt) exists or not.