Fix licensed libraries without URL classification - #188
Conversation
Libraries which indicate their license but without url gets defaulted into NoneSpecified which breaks license categorization for these libraries This change fixes that problem
|
Thanks for the PR, would it be possible to write a test for this? There are already a lot of example tests and since you have an example (webjars) it shouldn't be too hard. |
|
Will do! |
|
Thinking about this now, I am wondering whether its a better idea to do this more comprehensively, i.e. rather than casting a missing url entry to empty string instead we should explicitly handle this case by looking up the dependency chain. @akilegaspi Do you want to see if this is easily possible? i.e. something like licenses.map { case (name, optionalUrl) =>
(name, optionalUrl.orElse(licenses.find{
//do logic here to find parent artifact that may have the apache url
})
}You will probably need to modify |
|
Been thinking about this for quite sometime, I don't think we should attempt to resolve a license for a child artifact from a parent artifact in the case that these two libraries might be licensed differently, this would work if we could be sure that the artifacts do have provably equal licenses which could only be known by actually having that information. We have this setting key But currently it isn't used as described and actually overrides for all artifacts instead of the described behavior and I think this should be used instead to actually allow overriding Another way I could think of to not break behavior for downstream users is to introduce a new setting key which acts the same as What do you think? |
Some Libraries indicate a license without a url which gets defaulted into
NoneSpecifiedwhich breaks license categorization for these librariesThis change fixes that problem