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

Repair license header settings #15

Open
sjahreis opened this issue Jun 21, 2022 · 2 comments
Open

Repair license header settings #15

sjahreis opened this issue Jun 21, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@sjahreis
Copy link
Contributor

Describe the bug
License headers are not checked in frontend/src directory. Furthermore the license header's content isn't checked against the configured settings (like inception year)

Expected behavior

  • The license headers for files in frontend/src directory are checked.
  • The license header's content is checked.

Fix
Already fixed using the following snippet:

<!-- LICENSE -->
            <plugin>
                <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>
                    <inceptionYear>${project.inceptionYear}</inceptionYear>
                    <projectName>${project.artifactId}</projectName>
                    <copyrightOwners>linked-planet GmbH</copyrightOwners>
                    <failOnMissingHeader>true</failOnMissingHeader>
                    <failOnNotUptodateHeader>true</failOnNotUptodateHeader>
                    <roots>
                        <root>src</root>
                        <root>target/generated-sources</root>
                        <root>frontend/src</root>
                    </roots>
                    <excludes>
                        <exclude>**/*.min.js</exclude>
                        <exclude>**/*.js</exclude>
                        <exclude>**/plugin*.properties</exclude>
                        <exclude>**/version*.properties</exclude>
                        <exclude>**/log4j.properties</exclude>
                        <exclude>**/kaptKotlin/**/*</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>
@sjahreis sjahreis added the enhancement New feature or request label Jun 21, 2022
@weickmanna
Copy link
Member

@sjahreis I just released a new version 3.3.0.
I didn't add target/generated-sources ... maybe you still want to add it if you need it?
Also, I needed to exclude the frontend Application.kt file because the license plugin added the header in a wrong location due to some redux code it cannot deal with.

@sjahreis
Copy link
Contributor Author

@weickmanna That already happened in some of my files as well. You can manually fix the position of the license header and it will be accepted that way by the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants