Add missing ASF license headers and check them with Apache RAT - #194
Conversation
88 Roller-owned files had no license header: Java sources and tests (including most package-info.java files), JSPs, Velocity templates, Struts validation and menu definitions, ORM mappings, properties files, deployment descriptors, a release script, CodeQL configuration, and NetBeans action files. Each now carries the header in the comment style its neighbors use. Velocity templates put the closing *# directly in front of their first output so rendered pages and feeds are unchanged; templates that begin with a directive or comment get a line break after the header instead, which only adds a blank line to the generated SQL scripts. Third-party files keep their own licenses and are left alone: docker/wait-for-it.sh and the jQuery Mobile theme CSS, as are the bundled blog themes, whose templates are copied into users' editable weblog templates. The it-selenium module is left as is because the Playwright PR removes it.
|
we could let CI check this, e.g: <plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<version>0.18</version>
<configuration>
<inputExcludes>
<inputExclude>/src/main/webapp/themes/*</inputExclude>
<inputExclude>/src/main/webapp/favicon*</inputExclude>
<!-- more -->
</inputExcludes>
</configuration>
</plugin>plugin is off by default since it makes the build a bit slower, run with |
The apache-rat-plugin 0.18 is configured in the parent pom but not bound to the build, since it slows it down; run it with mvn apache-rat:check. A new License headers job in the workflow runs that check on every push and pull request. RAT found headers the earlier pass had missed, and those files now have them: the weblogger ORM mappings, persistence.xml, taglib.tld, context.xml-example, the dummy database scripts used by tests, the example code and build files under docs/examples, and the it-selenium resources. Seven test classes that used a shortened ASF notice get the full header, which RAT requires. The exclusions are documented in the pom: prose documentation, generated and data files, the bundled theme templates that users copy and edit, images, and third-party code with its own license.
|
Good idea, done. The apache-rat-plugin 0.18 is in the parent pom's pluginManagement, not bound to the build, so RAT caught files my first pass missed, which now have headers: the weblogger ORM mappings, The exclusions are commented in the pom: prose docs ( |
snoopdave
left a comment
There was a problem hiding this comment.
LGTM. let's merge this
About 140 Roller-owned files were missing the ASF license header: Java sources and tests (mostly package-info.java files), JSPs, Velocity templates, Struts validation and menu XML, the ORM mappings and
persistence.xml,taglib.tld, properties files, deployment descriptors, test DB scripts, the example code underdocs/examples,sign-release.sh, the CodeQL configs,db-utils/pom.xml,version-rules.xml, and the NetBeansnbactions.xmlfiles. Seven test classes used a shortened ASF notice and now have the full header. Each file gets the header in the comment style its neighbors already use.To keep it that way, the apache-rat-plugin 0.18 is configured in the parent pom (not bound to the build, since it is slow; run
mvn apache-rat:check), and a new "License headers" job in the workflow runs it on every push and PR. Its exclusions are commented in the pom.Velocity templates need care because comments sit in rendered output:
rsd.vm,popupcomments.vm,noop_decorator.vm, the menu and navbar templates) put the closing*#directly in front of their first output, the pattern the feed templates already use, so nothing they render changes.*##would turn the next line into a line comment. For the SQL templates this adds one blank line to each generated script, whichSQLScriptRunnerskips.I compared the generated database scripts before and after: they differ only by that blank line. All unit tests pass.
Excluded from RAT on purpose:
docker/wait-for-it.sh, the jQuery Mobile theme CSS, androller-ui/scripts/jquery-2.1.1.min.jsare third-party code with their own licenses.src/main/resources/themeshave never carried headers because they are copied into users' editable weblog templates.*.md,*.adoc), images, word lists and other data files, and the generated JMeter plan.