logo license-maven-plugin

Maven 2 plugin to check and update license headers in source files

homepage:
fresh index:
last release: 4 months ago, first release: 8 years ago
packaging: maven-plugin
get this artifact from: central
see this artifact on: search.maven.org


Display vulnerabilities (snyk): Vulnerability check

This chart shows how much is this artifact used as a dependency in other Maven artifacts in Central repository and GitHub:


select version:

Add this snippet into pom.xml inside tag <project><build><plugins>:




Switch to artifact.
goals:
license:check (phase: verify)

Check if the source files of the project have a valid license header

license:format

Reformat files with a missing header to add it

license:help

Display help information on license-maven-plugin. Call mvn license:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.

license:remove

Remove the specified header from source files

Often used code snippets:

<plugin>
  <groupId>com.mycila</groupId>
  <artifactId>license-maven-plugin</artifactId>
  <configuration>
    <excludes>
      <exclude>**/components.txt</exclude>
      <exclude>**/*.dtd</exclude>
    </excludes>
  </configuration>
</plugin>
<plugin>
  <groupId>com.mycila</groupId>
  <artifactId>license-maven-plugin</artifactId>
  <configuration>
    <excludes>
      <exclude>**/components.txt</exclude>
      <exclude>target-eclipse/**</exclude>
      <exclude>src/test/resources/**</exclude>
    </excludes>
  </configuration>
</plugin>
<plugin>
  <groupId>com.mycila</groupId>
  <artifactId>license-maven-plugin</artifactId>
  <configuration>
    <excludes>
      <exclude>**/components.txt</exclude>
      <exclude>**/*.ent</exclude>
      <exclude>**/*.dtd</exclude>
    </excludes>
  </configuration>
</plugin>
<plugin>
  <groupId>com.mycila</groupId>
  <artifactId>license-maven-plugin</artifactId>
  <configuration>
    <excludes>
      <exclude>**/*.cfg.xml.vm</exclude>
      <exclude>**/*.properties.vm</exclude>
      <exclude>**/*.cfg.vm</exclude>
    </excludes>
  </configuration>
</plugin>
<plugin>
  <groupId>com.mycila</groupId>
  <artifactId>license-maven-plugin</artifactId>
  <configuration>
    <excludes>
      <exclude>**/components.txt</exclude>
      <exclude>**/goal.txt</exclude>
      <exclude>**/it/**/goals.txt</exclude>
      <exclude>**/*.test</exclude>
      <exclude>**/*.in.*txt</exclude>
      <exclude>**/*.out.txt</exclude>
      <exclude>**/*.inout.txt</exclude>
      <exclude>**/*.in.*xml</exclude>
      <exclude>**/*.out.xml</exclude>
      <exclude>**/*.inout.xml</exclude>
      <exclude>**/ctstest/type/test/test1.inout.xml</exclude>
      <exclude>**/ApplicationResources_*.properties</exclude>
    </excludes>
  </configuration>
</plugin>

© Jiri Pinkas 2015 - 2022. All rights reserved! Admin login To submit bugs / feature requests please use this github page
related: JavaVids | Top Java Blogs | Java školení
Apache and Apache Maven are trademarks of the Apache Software Foundation. The Central Repository is a service mark of Sonatype, Inc.