Is anyone here aware of tooling that uses `pom.lic...
# dependency-management
m
Is anyone here aware of tooling that uses
pom.license.url
in addition to
pom.license.name
? We're considering removing the url from our poms because they duplicate information and make the pom validation somewhat harder: url can take many forms while
license.name
can point to a well defined SPDX id. Are we breaking someone's workflow by doing this?
v
The
com.github.jk1.dependency-license-report
plugin for example uses it in its report.
👀 1
m
Does it break if I remove it or is the report less complete?
v
And also in match rules for normalization
m
match rules for normalization
Do you have a pointer for that?
v
report would be less complete, matching can be broken then, a.k.a. not match for normalization anymore what matched before
pointer to what exactly?
m
the normalization algorithm
I want to check if it would make any difference for our libs
v
Why would it not?
m
If it wasn't able to use our url before then removing it is fine
v
Sorry if I sound stubborn, but why should it not be able to before? (Besides that there are surely more code out there using the url)
m
A url is not really machine processable by default
I can host the license on my own domain, etc...
So I get that it's human processable (displayed in reports to be processed by humans)
But curious how machine process them
v
It is matched with regexes, and the regexes are configurable by each user of the plugin
m
Devil advocate here but nothing prevents me to put the Apache license at https://example.com/license/MIT
So the whole stuff feels very fragile
v
Yes it is, but that's how it is. The plugin very much depends on heuristics. It also searches for some hard-coded license files within the jar to detect the used license.
m
SPDX is a thing now
Trying to encourage that I guess
v
Sure, make every 20 year old mature lib out there change their POM 😉
m
I'm talking about my own lib
v
Or the new libs coming out where maintainers are not aware of how to do it
m
Some of them are mature though 😄
(not all of them 🙃 )
v
Yes, I said "mature"
To differentiate from "unmaintained"
m
It'll take some time but feels like we can steer the ecosystem toward a more robust solution
v
"some" is very stretchy there 😄
m
I'm a belieber!
v
Aaand of course, using the SPDX for
name
is just a recommendation, so you can also not rely on that
https://maven.apache.org/pom.html#Licenses
Using an SPDX identifier as the license name is recommended.
👍 1
m
Oh yea, I'm asking all of that from the point of view of a pom producer, not consumer
Be strict about what I send (the tooling can be flexible about what it accept)
p
According to the specs, the description is
The official url of the license text.
It does not mention MUST or SHOULD. And it is optional… https://maven.apache.org/ref/3.9.9/maven-model/maven.html#class_license
👀 1
🙏 1
m
I was a bit anxious Sonatype would mandate it but from my tests, they don't mind if license url is missing
p
For my projects, it’s is simple, I only use Apache 2, so I use the SPDX Id as name and the official url as url. But things will be complicated if you use another license, copy it and fill out the placeholders.
m
Yea, that's exactly our problem, the default url text contains placeholders so it's not really correct (we're using MIT)-
Therefore considering removing the problem altogether by removing the url 😄
v
The license text actually does not contain placeholders, that would be a jurisdictional nightmare
Only the instructions how to apply the license contain placeholders
And those are not part of the license itself but only additional information
So if there are placeholders, that's pretty irrelevant and absolutely ok
p
In that cause I would put the url of your license into the field, because the text itself is not valid without filling the placeholders (like an empty formula). But on the other hand I would say, ignore it. You do express your intention to license your work under MIT and your! license is checked in in your repo (isn’t it?).
m
You do express your intention to license your work under MIT and your! license is checked in in your repo (isn’t it?).
That's my thinking too. The source of truth for the license text is the file itself alongside the code
v
Again, the license does not contain placeholders.
m
I'm talking abuot this: ou do express your intention to license your work under MIT and your! license is checked in in your repo (isn’t it?).
@Vampire the template does: https://spdx.org/licenses/MIT.html
p
But the MIT license contains the copyright placeholder 🤔
m
Our pom currently contains this (which we are considering dropping): https://github.com/apollographql/apollo-kotlin/blob/main/LICENSE
v
Hm, well, I guess that is unlucky that this line is in the license text, or just that site is misleading. The copyright line should not be part of the license text. It just shows how you apply it to your file where you should contain the copyright line.
m
So you're saying maybe there's a MIT license url somewhere without the placholders?
IANAL but feels a bit weird to link to a "partial" license if that's the case
v
I don't know whether there is, I'd hope so. But even if not, either way the copyright line is not part of the license
IANAL too of course
m
My current train of thought is "no information" => "no problem"
I'm giving out the SPDX id for machine processing. If anyone wants more info, they need to go to the repo
v
Hm, well, maybe I'm wrong in case of the MIT license actually. As the license text refers to the copyright line, it probably is considered part of the license. 🤷‍♂️
Well, add a link to the license file in your repo instead of the placeholdered one, problem solved too 🙂
m
Well, add a link to the license file in your repo instead of the placeholdered one, problem solved too
Not really because tools get confused by that extra information
v
Well, not the problem that you might break consumers relying on the old one, but problem of missing url 🙂
Some tools will get confused
v
Some other tools will miss information as they will not parse the name, or generate an url from the name
m
you might break consumers relying on the old one
Yep, that's the tradeoff. How many am I breaking vs how many am I fixing
Overall, I feel like the breaking solution is more robust moving forward so tempted to adopt it and see where it goes
We need deprecation notice for pom fields 😄
v
Probably not fixing anyone by removing information. :-D
m
It's removing ambiguity, information is still there (but not in the pom)
v
I'd say, if a tool disallows urls, this is a bug in that tool. Especially as in the MIT case you are supposed to fill in placeholders, so should always link to your version. The MIT license also is not copyrighted itself, so you also can freely modify it to your needs.
p
I also do use licensee and IMHO adding the custom license url of a dependency to the list is just a one-time job 🤷🏻‍♂️
v
But tedious and unnecessary when the lib could provide the link to their version of the license.
m
Yea, if you have dozens of dependencies it can be a bit cumbersome I guess
p
Ah I mean when using the licensee plugin you have to white list any MIT licenses with a custom url. But that is a one time job, the license rarely change.
👍 1
m
I think we'll try it out. It's not a huge deal either. Worst case users complain about it and have to stay on the n - 1 version until we do another release. It makes us look bad a little bit but at least we'll have our answer.
v
Interesting find: https://github.com/remy/mit-license You can do a
curl
request and end up with a personalized version like https://rem.mit-license.org/
👀 1