logo maven-license-plugin

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

homepage: code.google.com/p/maven-license-plugin
fresh index:
last release: 1 decade ago, first release: 1 decade 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:remove

Remove the specified header from source files

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

Often used code snippets:

<plugin>
  <groupId>com.mycila.maven-license-plugin</groupId>
  <artifactId>maven-license-plugin</artifactId>
  <configuration>
    <header>${header.location}</header>
    <excludes>
      <exclude>src/test/java/**.tree</exclude>
    </excludes>
  </configuration>
</plugin>
<plugin>
  <groupId>com.mycila.maven-license-plugin</groupId>
  <artifactId>maven-license-plugin</artifactId>
  <configuration>
    <aggregate>true</aggregate>
    <header>src/etc/header.txt</header>
    <strictCheck>true</strictCheck>
    <encoding>UTF-8</encoding>
    <excludes>
      <exclude>.idea/**</exclude>
      <exclude>LICENSE.txt</exclude>
      <exclude>**/test/**/*.txt</exclude>
      <exclude>**/site/**</exclude>
    </excludes>
  </configuration>
</plugin>
<plugin>
  <groupId>com.mycila.maven-license-plugin</groupId>
  <artifactId>maven-license-plugin</artifactId>
  <configuration>
    <excludes>
      <exclude>**/*.cfg.xml.vm</exclude>
      <exclude>**/*.properties.vm</exclude>
      <exclude>**/*.cfg.vm</exclude>
    </excludes>
  </configuration>
</plugin>
<plugin>
  <groupId>com.mycila.maven-license-plugin</groupId>
  <artifactId>maven-license-plugin</artifactId>
  <configuration>
    <excludes>
      <exclude>**/components.txt</exclude>
      <exclude>**/*.ent</exclude>
      <exclude>**/*.dtd</exclude>
    </excludes>
  </configuration>
</plugin>
<plugin>
  <groupId>com.mycila.maven-license-plugin</groupId>
  <artifactId>maven-license-plugin</artifactId>
  <configuration>
    <includes>
      <include>**/*.java</include>
      <include>**/*.bat</include>
      <include>**/*.sh</include>
    </includes>
  </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.