Skip to content

matchGroupIdAndPackage

Wisen edited this page Jan 26, 2014 · 2 revisions

Enforces a module to contain a package that matches its group id.

Supported parameters:

  • message - an optional message to the user if the rule fails.

Sample plugin configuration:

<project>
  <groupId>com.ceilfors.foo</groupId>
  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.0</version>
        <executions>
          <execution>
            <id>enforce</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <!-- Checks if the package com.ceilfors.foo exists in the source directories -->
                <matchGroupIdAndPackage/>
              </rules>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.ceilfors.maven.plugin</groupId>
            <artifactId>enforcer-rules</artifactId>
            <version><!-- replace with the latest version --></version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>
  [...]
</project>
Clone this wiki locally