license-maven-plugin icon indicating copy to clipboard operation
license-maven-plugin copied to clipboard

remove-file-header does not restore the files to the original state

Open ngrigoriev opened this issue 5 years ago • 1 comments

I was under assumption that "remove-file-header" goal would restore my files to their original state, as they were before using update-file-header. I currently observe (plugin version 1.20) the following issues:

  1. Generated headers are NOT being removed from the following files in my project: Dockerfile, *.sh
  2. Removing the header leaves an empty line at the top of each file at least for *.java, *.groovy

How to reproduce:

  • create a project with some Java files, .groovy, Dockerfile, .sh
  • run "license:update-file-header" - it will populate the license headers
  • run "license:remove-file-header"
  • note that some files will still have the license header and others will have an empty line at the top

Environment: OpenJDK 11, Mac OS X, Maven 3.6.1, plugin 1.20

ngrigoriev avatar May 02 '19 19:05 ngrigoriev

A reproducer in form of an integration test under https://github.com/mojohaus/license-maven-plugin/tree/master/src/it would be highly welcome.

The bottom line is that there is no test for remove-file-header mojo yet, so no wonder that it is broken.

ppalaga avatar May 03 '19 06:05 ppalaga