Mandatory email in APACHE-2 template
Version affected
4.1
Describe the bug
I'm not sure this is a bug or it's by design so please accept my apologies if it's not the case.
Currently, the APACHE-2 built-in template requires a mandatory email value for the copyright line, producing an output like:
Copyright 2023 Owner Name ([email protected])
Licensed under the Apache License, Version 2.0 (the "License");
...
However, the header suggested by the APACHE-2 license page only mentions:
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
...
without any explicit requirement for an email address in the copyright line.
If I don't specify the email property, I get a result like the following:
Copyright 2023 Owner Name (${email})
Licensed under the Apache License, Version 2.0 (the "License");
...
while I would like to get:
Copyright 2023 Owner Name
Licensed under the Apache License, Version 2.0 (the "License");
...
Aside from defining a custom header, I don't see any way to reach the result I'd like to have.
Would you consider some changes to achieve my last example with the built-in template? If yes, I can try to raise a PR.
How to Reproduce
Define:
<configuration>
<licenseSets>
<licenseSet>
<header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header>
<includes>
<include>src/**/*.java</include>
</includes>
</licenseSet>
</licenseSets>
<properties>
<year>2023</year>
<owner>Owner Name</owner>
</properties>
</configuration>
and execute license:format.
If you can send PR that keeps current behavior while making it possible to do the new behavior I think that we can accept. I agree with your comments otherwise and while I don't use the templates any apache 2 I've done look as you have noted.
Personally I'm against emails there anyway for same reason I'm sure github does their best to hide ours. Otherwise we get random inquires we don't ask for. So definitely feel free to raise PR. Looking forward to review.
Sent from my Verizon, Samsung Galaxy smartphone Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Stefano Cordio @.> Sent: Saturday, April 1, 2023 12:05:23 PM To: mathieucarbou/license-maven-plugin @.> Cc: Subscribed @.***> Subject: [mathieucarbou/license-maven-plugin] Mandatory email in APACHE-2 template (Issue #532)
Version affected
4.1
Describe the bug
I'm not sure this is a bug or it's by design so please accept my apologies if it's not the case.
Currently, the APACHE-2 built-in templatehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmathieucarbou%2Flicense-maven-plugin%2Fblob%2Fmaster%2Flicense-maven-plugin%2Fsrc%2Fmain%2Fresources%2Fcom%2Fmycila%2Fmaven%2Fplugin%2Flicense%2Ftemplates%2FAPACHE-2.txt&data=05%7C01%7C%7C43aab3e715044098e0a208db32cae6d1%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638159619260618477%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ni%2BftIQ%2FNt38xMnIyt8vegrsvoQZPGAbSsswjAoHY%2Fw%3D&reserved=0 requires a mandatory email value for the copyright line, producing an output like:
Copyright 2023 Owner Name @.***)
Licensed under the Apache License, Version 2.0 (the "License"); ...
However, the header suggested by the APACHE-2 license pagehttps://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.apache.org%2Flicenses%2FLICENSE-2.0&data=05%7C01%7C%7C43aab3e715044098e0a208db32cae6d1%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638159619260618477%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=81pTb1MdRbie%2F5Wm%2B3bLHXpJJMxhHU9zjPBNkLkX5do%3D&reserved=0 only mentions:
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License"); ...
without any explicit requirement for an email address in the copyright line.
If I don't specify the email property, I get a result like the following:
Copyright 2023 Owner Name (${email})
Licensed under the Apache License, Version 2.0 (the "License"); ...
while I would like to get:
Copyright 2023 Owner Name
Licensed under the Apache License, Version 2.0 (the "License"); ...
Aside from defining a custom header, I don't see any way to reach the result I'd like to have.
Would you consider some changes to achieve my last example with the built-in template? If yes, I can try to raise a PR.
How to Reproduce
Define:
<configuration>
<licenseSets>
<licenseSet>
<header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header>
<includes>
<include>src/**/*.java</include>
</includes>
</licenseSet>
</licenseSets>
<properties>
<year>2023</year>
<owner>Owner Name</owner>
</properties>
</configuration>
and execute license:format.
— Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmathieucarbou%2Flicense-maven-plugin%2Fissues%2F532&data=05%7C01%7C%7C43aab3e715044098e0a208db32cae6d1%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638159619260618477%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=eR4cjVCdo4wsWr%2BGERWzM97zIwJdJ2%2FIYmEg22%2BqHdk%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAHODI7EW77DNNVPR2AZZATW7BG4HANCNFSM6AAAAAAWPW2THA&data=05%7C01%7C%7C43aab3e715044098e0a208db32cae6d1%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638159619260618477%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=S50i%2FJ%2F4ZxLw1IdorMswA1srJbPZoNOxt2%2BOlpyv%2FvI%3D&reserved=0. You are receiving this because you are subscribed to this thread.Message ID: @.***>
Hi @hazendaz, I started to look into this topic.
My idea would be to manipulate the string output after the properties are applied to the template, removing (${email}) if there was no email property.
As far as I can see, there are no tests for the built-in templates and maybe I could start by adding them. I imagine the tests should belong to one of the classes in com.mycila.maven.plugin.license.header but I couldn't figure out the right candidate.
I'll take a deeper look over the next few days but I'm happy to follow your suggestions if you have any.
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Keep this open.
Thanks @hazendaz and thanks stale-bot for the reminder 😅
I'll try to come back to this topic in the coming weeks.
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Yes, still relevant! 🙂
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Stale bot should have a way of marking something to not be reminded about again :)
Yes, still relevant! (Too late?)
@scordio : you will be able to point to com/mycila/maven/plugin/license/templates/APACHE-2-noemail.txt in next version.
Thanks a lot for taking care of it!