mathieucarbou / license-maven-plugin

Manage license headers in your source files

Home Page:https://oss.carbou.me/license-maven-plugin/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing header log message is incomplete

elharo opened this issue · comments

Version affected

com.mycila:license-maven-plugin:2.3

Describe the bug

Typical log message when a header is missing:
[WARNING] Missing header in: /home/elharo/foo/src/main/java/com/bar/MyClass.java

A clear and concise description of what the bug is.

This clearly identifies which file is at fault, which is good. However it does not provide any information about what the missing header is or how to fix it. Not a URL, not a link, not a file path. Nothing. Yes, experienced developers can probably dig through several layers of nested config files to figure this out, or perhaps copy and paste from an existing file, but why should they have to? The tool already knows what's expected and missing, so it should tell the user, not make them hunt for it.

can you write up a pull request to resolve this?

@elharo : I disagree. The fact that the header is missing or invalid does has nothing to do with what to except. In some situations one might one to resolve by just excluding the files. In the case of dual licensed projects, the plugin also might not know which license to apply.

Anyway... It is up to the user to check abd decide what to do. Not the plugin.

I'm not asking the plugin to fix this, just to be clearer about what the problem is. Presumably it's searching for some string that isn't there. The log should tell me what string is missing. When I hit this error, it was far from obvious what was missing.

E.g. in the case of a dual licensed project, or better yet a project with files under different licenses, a badly configured plugin might fail when it sees one license but not another. The dev looks in the file at fault and sees what looks like a correct license. They're probably not going to immediately guess that the plugin is configured to look for Apache and not BSD or vice versa. If the plugin tells them it couldn't find the Apache License, then the problem would be clearer.