In the past, I tried to add a license header using apache rat, but some problems have occurred. I have discussed with Philipp Ottlinger on these issues. ref: https://issues.apache.org/jira/browse/RAT-255
Current problems: 1. The maven plugin of apache rat automatically adds the license header. The header cannot be placed at the beginning of the file, but after the package and before the import. 2. The license header does not strictly match the number of broken lines per line. 3. When setting copyrightMsg, it cannot format in the given format. 4. When using the apache rat command line, it was found that it could not be run. My opinion about apache rat is that it is good at checking the license header instead of automatically adding the license header, because I found a lot of problems when adding the license header automatically. I also have some doubts about using apache rat in dubbo, is it really working? We configured -Drat.skip=false in .travis.yml, but we missed some files that are not part of the ASF license header in the file exclusion list of the rat plugin. Please refer to pr: https://github. com/apache/dubbo/pull/4318/files , the files I added are from netty and MIT headers. Why is the rat plugin not checking for problems? In summary, I hope that dubbo can add mycila plugin to complete the automatic add and format license header. 在 2019/6/5 下午10:00,“Justin Mclean”<[email protected]> 写入: Hi, > It's good to know rat plugin can do this, but we need figure out how to > apply rat plugin to file like `InternalThreadLocal.java` ( > https://github.com/apache/dubbo/blob/master/dubbo-common/src/main/java/org/apache/dubbo/common/threadlocal/InternalThreadLocal.java > ) If it’s "Copyright 2014 The Netty Project" I guess you don't need to change it, so add it rat exclusions and it will not change the header. The -a option will give you a good idea of what rat will do and -A option will do it. Thanks, Justin
