mojohaus/license-maven-plugin

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

Open

#330 opened on May 2, 2019

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Java (127 forks)auto 404
file-headerhelp wanted

Repository metrics

Stars
 (115 stars)
PR merge metrics
 (PR metrics pending)

Description

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

Contributor guide