Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

license:check-file-header wrongly fails build #54

Open
jieryn opened this issue Jul 20, 2016 · 6 comments
Open

license:check-file-header wrongly fails build #54

jieryn opened this issue Jul 20, 2016 · 6 comments

Comments

@jieryn
Copy link
Contributor

jieryn commented Jul 20, 2016

http://www.mojohaus.org/license-maven-plugin/check-file-header-mojo.html

Perhaps a misunderstanding, but I understood license:check-file-header -Dlicense.failOnMissingHeader=true -Dlicense.failOnNotUptodateHeader=true to be similar to other plugins which will not update the source code, but instead check for compliance according to the rules of the plugin. So, when I invoke it, if any files in my source tree would require a license header update, then the build should fail. Instead, it is failing even when license:update-file-header makes no changes to any source files..

@jieryn
Copy link
Contributor Author

jieryn commented Jul 20, 2016

I did some quick testing and found that description for all my licenses was being updated to have a spurious 0x10 at the end. I edited src/main/resources/org/codehaus/mojo/license/default-file-header-description.ftl to have no newline at the end (removing all leading comments and the freemaker check at the bottom) so it is literally just ${projectName} with no newline at the end; and now my license:check-file-header -Dlicense.failOnMissingHeader=true -Dlicense.failOnNotUptodateHeader=true works perfectly. What can be done about this?

@tchemit
Copy link
Contributor

tchemit commented Jan 3, 2017

@jieryn For the first pb could you give my a little project explaining the defect. thanks

@tchemit tchemit modified the milestone: Backlog Jun 11, 2017
@tchemit
Copy link
Contributor

tchemit commented Aug 21, 2017

@jieryn , any news about this problem ? If no response in the next weenk, I will close this issue since I really don't know what to do...

@jessefarinacci
Copy link

I hit the same issue, but the workaround provided ..worked. Think it is safe to close this as a really really odd case when using custom licenses. I vote let it close.

@ppalaga
Copy link
Contributor

ppalaga commented Jan 4, 2019

If this issue still occurs, then a reproducer in form of an integration text under https://github.com/mojohaus/license-maven-plugin/tree/master/src/it would be welcome.

@weickmanna
Copy link

Same issue here. We are using standard apache_v2 license.
Our config:

                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>2.0.0</version>
                <configuration>
                    <licenseName>apache_v2</licenseName>
                    <licenseFile>${project.basedir}/LICENSE</licenseFile>
                    <projectName>${project.artifactId}</projectName>
                    <copyrightOwners>The Plugin Authors</copyrightOwners>
                    <failOnMissingHeader>true</failOnMissingHeader>
                    <failOnNotUptodateHeader>true</failOnNotUptodateHeader>
                    <canUpdateCopyright>true</canUpdateCopyright>
                    <canUpdateDescription>true</canUpdateDescription>
                    <excludes>
                        <exclude>**/plugin.properties</exclude>
                    </excludes>
                    <excludedScopes>provided,test</excludedScopes>
                </configuration>
                <executions>
                    <execution>
                        <id>license-check-file-header</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check-file-header</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Error goes away if I:

  • Remove failOnNotUptodateHeader (which is what I want to use however)
  • Remove both canUpdateCopyright and canUpdateDescription flags (which I want to use however to make the license header check more strict, since project names can get messed up if files are copied from other projects)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants