feat: use license-maven-plugin to allow generation of license file headers #103
Conversation
@kreincke think this is a nice improvement - what do you think? |
@CCFenner / @jhagestedt With respect to the idea, I did some research on the master branch to see what's our reality: Using the command 'find . -type f -name "*.java" | wc -l' I counted the number of our java files = 29 Using the command 'find . -name "*.java" -type f | while read F; do echo $F; grep (C) $F; done | tee cpos.txt' I created a list of all java files and added its copyright line if it exists. Using the command 'cat cpos.txt | grep \C) | wc -l' I counted the files with a copyright line= 28. Hence one file does not contain our file header Using the command 'cat cpos.txt | grep \C)' I reviewed the quality of the copyright lines: CONCLUSION: But before we can approve the PR I need to understand how it works. Reason: we must allow our employees/committers to add their names to the default CRL. The right to be named as author cannot be transferred (to anyone, hence also not to our company). And if the developers decided to insert their names, we must not erase such 'manually created CRLs'. Moreover, we must also allow, that they - and external committers - integrate their own deviating CRL. Example: If I wrote a file, it would contain the CRL '(C) 2020 Karsten Reincke, Deutsche Telekom AG ' (instead of TSI) So let me ask:
Can anyone answer my questions and give me some details? Again: Many thanks for the work. It is a win beyond this project. If we find a solution, we could offer this approach to all other maven based projects of our company [@CCFenner Hence you should add your copyright line and the license hint into your files, even if they are only 'configuration' files. The fact, that we discuss it is an indicator, that it is copyrightable ;-)]) Best regards Karsten |
The plugin is not configured to run on any maven lifecycle phase, so no, it will only run if invoked with
As stated above, the plugin needs the tags in place to insert at the correct location. Otherwise it just adds a new header.
A contributor would simply call |
@CCFenner / @jhagestedt : We just examined the proposal and we saw that it is a very good solution. In the next week we will accept the pull request, create an update-branch, and replace all existing headers by the version created by the plugin. Finally, we will adopt this technique into our general list of compliance tools for DT. Many thanks for your work! |
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.
Approved, ready to merge.
Description
This change adds configuration for the license-maven-plugin to generate the following file header:
Usage
Run
mvn license:remove-file-header
to remove old license headers andmvn license:update-file-header
to generate headers everywhere (**/*.java
) it is missing.For the sake of a simple review I did not add the ~30 java files with updated header.