• 0.27.2

Usage

It's easy (you need to use Maven version >= 3.1.0):

<build>
  <plugins>
    <plugin>
      <groupId>com.qulice</groupId>
      <artifactId>qulice-maven-plugin</artifactId>
      <version>0.27.2</version>
      <configuration>
        <license>file:${basedir}/LICENSE.txt</license>
      </configuration>
      <executions>
        <execution>
          <goals>
            <goal>check</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

Pay attention to the license configuration parameter. It is mandatory and has to be provided, or else the default value will be used (./LICENSE.txt). You can refer to a file with file: prefix, as in the example above. Or you can refer to a resource from classpath (very useful when you want to keep your license in a dedicated child module.

License text file should contain just text. Qulice converts this file to proper format and compares it with your source code file headers. For example, this is your LICENSE.txt:

Copyright (c) 2011-2026 Yegor Bugayenko

All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met: no conditions.

This is what your Java sources should start from:

/**
 * Copyright (c) 2011-2026 Yegor Bugayenko
 *
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met: no conditions.
 */

Multi-Module Setup

In a multi-module setup we recommend you to move all supplementary resource (assemblies, XML configurations, etc) to a separate "tool kit" sub-module. This module is the best place for LICENSE.txt file:

<build>
  <plugins>
    <plugin>
      <groupId>com.qulice</groupId>
      <artifactId>qulice-maven-plugin</artifactId>
      <version>0.27.2</version>
      <configuration>
        <license>LICENSE.txt</license>
      </configuration>
      <dependencies>
        <dependency>
          <!-- this is your tool kit module -->
          <groupId>com.example</groupId>
          <artifactId>foo</artifactId>
          <version>0.1.2</version>
        </dependency>
      </dependencies>
      <executions>
        <execution>
          <goals>
            <goal>check</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

POM XPath Assertions

Qulice can validate your pom.xml against a list of XPath queries. Each query has to find at least one node in the POM, otherwise the build will fail. Configure the queries via the asserts parameter:

<build>
  <plugins>
    <plugin>
      <groupId>com.qulice</groupId>
      <artifactId>qulice-maven-plugin</artifactId>
      <version>0.27.2</version>
      <configuration>
        <asserts>
          <param>/pom:project/pom:build/pom:plugins/pom:plugin[pom:artifactId='qulice-maven-plugin']/pom:artifactId/text()</param>
          <param>/pom:project/pom:dependencies/pom:dependency[pom:artifactId='commons-io']/pom:version[.='1.2.5']/text()</param>
        </asserts>
      </configuration>
    </plugin>
  </plugins>
</build>

The pom namespace prefix is bound to http://maven.apache.org/POM/4.0.0 and must be used in every component of every XPath query. Each query must end with /text().

Cutting Edge Version

If you want to use current version of the product, you can do it with this configuration in your pom.xml:

<pluginRepositories>
  <pluginRepository>
    <id>oss.sonatype.org</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
  </pluginRepository>
</pluginRepositories>
<build>
  <plugins>
    <plugin>
      <groupId>com.qulice</groupId>
      <artifactId>qulice-maven-plugin</artifactId>
      <version>1.0-SNAPSHOT</version>
      [...]
    </plugin>
  </plugins>
</build>