-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to license-maven-plugin:4.1 #550
Conversation
I noticed that the license header is using the JAVADOC comment style:
This means that a class may have TWO class-level javadoc sections: one with the license and a second with the actual class documentation. IMHO the license header should be enclosed in a standard comment block like this:
If you agree with that, I can easily update the header in all source files to conform with this style as part of this PR... |
- Update POM to use the latest version of the Mycila license plugin (and correct GAV). - Move plugin configuration inside the <pluginManagement> section so the plugin can be manually invoked from the command line. Particularly handy to fix header issues automatically… - Change the build process to “check” the files only and fail the build if not valid. - Remove the custom lifecycle-mapping: latest versions of the plugin have support for M2E Related issue: logfellow#549
Nice!
Yes, please do. I never noticed that. |
Oh, while you're modifying the license stuff... can you add a copyright to the header and each file to which it applied? like this:
See also #536 and spring-projects/spring-boot#27021 (comment), and an example According to that comment, leave the template value in LICENSE as-is, but just apply the copyright to the header, and each file. |
I can of course add the copyright in the header... but I'm a bit worried about the date range... (1) Is it the "current year"? In this case, should we update all files next year? This may not be an issue: the plugin can help us with this task! (2) Is it the year of the last modification of the file? Then we need to configure the license plugin to get that information from Git... This is supported by the plugin but comes with many drawbacks. First performances are horrible. Second, you start having strange behaviour depending on whether the file is modified, staged, new or renamed. The rename is even more confusing as it depends on Git detecting the rename or not - and as you know this depends on ho similar the file is with another (and sometimes Git says the file is renamed although it is a brand new one)... We took that road at work for several years and finally decided to drop any "git" dates in the header! |
There is no perfect solution, but this problem isn't unique to logstash-logback-encoder. So, we could follow the same practice as others do, like spring-boot. As part of this one-time task, stamp everything with 2021. Just keep an eye out for any pull requests, and update the headers manually then. If that becomes a problem, we can manually bump the year next year. I'm not worried about a once-a-year maintenance task. |
Change comment style from JAVADOC to SLASHSTAR Add copyright as first line
Oh... this odd - Here is part of the stacktrace:
Should I just change the expected value to |
Maybe we should remove the header check from the checkstyle rules as well?
|
I'm guessing the hash changed because of line number changes (?)
Yes
I kind of like keeping the checkstyle rule, since checkstyle plugins in IDEs will highlight the problem (vs having to wait until a maven build) |
…nal lines in the license header
I see the point. |
Build is still failing but because of the flaky |
Done. And filed #560 to address flaky test |
pom.xml
Outdated
<maven-bundle-plugin.version>5.1.2</maven-bundle-plugin.version> | ||
<maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version> | ||
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version> | ||
<maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version> | ||
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version> | ||
<maven-jar-plugin.version>3.2.0</maven-jar-plugin.version> | ||
<maven-javadoc-plugin.version>3.3.0</maven-javadoc-plugin.version> | ||
<maven-license-plugin.version>1.9.0</maven-license-plugin.version> | ||
<license-maven-plugin.version>4.1</license-maven-plugin.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit put this in alpha order
Update POM to use the latest version of the Mycila license plugin (and correct GAV).
Move plugin configuration inside the section so the plugin can be manually invoked from the command line. Particularly handy to fix header issues automatically…
Change the build process to “check” the files only and fail the build if not valid.
Related issue: #549