fix(build): expose module licenses in generated license reports#68
fix(build): expose module licenses in generated license reports#68Ludy87 wants to merge 1 commit into
Conversation
Isn't this a pre-req for using these dependencies anyway? For example we define dependencyManagement in the HubSpot basepom. If for some reason you can't resolve that, then you wouldn't get the correct transitive dependencies.
Unless I'm missing something, this feels like a bug in the license plugin, and we should fix it there rather than adding a bunch of extra stuff to every pom that should be inherited |
|
I think I found the error in https://github.com/HubSpot/jinjava/blob/master/pom.xml. It uses version 1.5 Licenses: The Apache License, Version 2.0 were only added with version 1.6 https://central.sonatype.com/artifact/com.hubspot/algebra/1.6.0 https://central.sonatype.com/artifact/com.hubspot/algebra-parent/1.6.0 @jasmith-hs Can we find a solution for this? |
|
Thanks for tracking that down, we can update jinjava to use a newer version of algebra (or you can use dependencyManagement to override the algebra version for a quicker fix) |
|
Should be fixed by HubSpot/jinjava#1324 |
Description of Changes
Added Apache License 2.0 metadata to the Maven POM files for:
algebra-jacksonalgebra-testingalgebraThis change ensures that the modules' license is detected and displayed.
Previously, no license information was shown for these modules because their POM files did not explicitly declare a license.
Why the license metadata was not detected
com.github.jk1.dependency-license-reportderives license information from the Maven metadata of each resolved dependency rather than from the repository'sLICENSEfile.The affected module POMs did not contain their own
<licenses>section. The Apache 2.0 license was declared only in the parent project POM. Although the plugin supports collecting licenses from parent POMs, this depends on the complete parent POM chain being resolved and interpreted correctly. For these artifacts, that inherited license did not result in usable module-level license metadata, so the modules appeared without a license incheckLicenseandgenerateLicenseReport.Declaring the Apache 2.0 license directly in every published module POM makes each artifact's metadata self-contained. This allows the plugin to detect the license reliably without depending on parent POM traversal.