Skip to content

Latest commit

 

History

History
51 lines (44 loc) · 1.92 KB

README.md

File metadata and controls

51 lines (44 loc) · 1.92 KB

Build Status

This Maven Enforcer Rule checks your project for package cycles. It fails the build if any package cycle is found, showing you the packages and classes involved in the cycle.

Usage: Add the following plugin to your POM:

<plugin>
	<artifactId>maven-enforcer-plugin</artifactId>
	<version>1.4.1</version>
	<dependencies>
		<dependency>
			<groupId>de.andrena.tools.nopackagecycles</groupId>
			<artifactId>no-package-cycles-enforcer-rule</artifactId>
			<version>1.0.7</version>
		</dependency>
	</dependencies>
	<executions>
		<execution>
			<id>enforce-no-package-cycles</id>
			<goals>
				<goal>enforce</goal>
			</goals>
			<phase>test</phase>
			<configuration>
				<rules>
					<NoPackageCyclesRule implementation="de.andrena.tools.nopackagecycles.NoPackageCyclesRule" />
				</rules>
			</configuration>
		</execution>
	</executions>
</plugin>

If you want to exclude tests from cycle checking you can use the parameter includeTests which is set to true by default:

				...
				<rules>
					<NoPackageCyclesRule implementation="de.andrena.tools.nopackagecycles.NoPackageCyclesRule">
						<includeTests>false</includeTests>
					</NoPackageCyclesRule>
				</rules>
				...

See also: