-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
let BanDuplicateClasses ignore when the bytecode matches exactly (#50)
Fixed #54 - let ban duplicate classes ignore when the bytecode matches exactly * fix checkstyle warnings and errors * update documentation with new BanDuplicateClasses option
- Loading branch information
1 parent
7e4ebf0
commit 764ba34
Showing
19 changed files
with
1,369 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/it/banduplicate-classes-fail-when-not-identical/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
invoker.goals = enforcer:enforce | ||
invoker.buildResult = failure |
64 changes: 64 additions & 0 deletions
64
src/it/banduplicate-classes-fail-when-not-identical/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.apache.maven</groupId> | ||
<artifactId>banduplicate-classes-ignore-when-identical</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-enforcer-plugin</artifactId> | ||
<version>@enforcerPluginVersion@</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
<version>@project.version@</version> | ||
</dependency> | ||
</dependencies> | ||
<configuration> | ||
<rules> | ||
<BanDuplicateClasses> | ||
<ignoreWhenIdentical>true</ignoreWhenIdentical> | ||
</BanDuplicateClasses> | ||
</rules> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>compile</phase> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-api</artifactId> | ||
<version>2.9.0</version> | ||
<scope>runtime</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>commons-logging</groupId> | ||
<artifactId>commons-logging</artifactId> | ||
<version>1.2</version> | ||
</dependency> | ||
|
||
<!-- these classes duplicate those in commons-logging, and the bytecode won't match | ||
(that's the trick SLF4J uses: it rewrites some of the commons-logging classes | ||
to make them work with SLF4J instead) --> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>jcl-over-slf4j</artifactId> | ||
<version>1.7.25</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
</project> |
6 changes: 6 additions & 0 deletions
6
src/it/banduplicate-classes-fail-when-not-identical/verify.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
File file = new File( basedir, "build.log" ) | ||
assert file.exists() | ||
|
||
String text = file.getText( "utf-8" ) | ||
|
||
return true |
2 changes: 2 additions & 0 deletions
2
src/it/banduplicate-classes-ignore-when-identical/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
invoker.goals = enforcer:enforce | ||
invoker.buildResult = success |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.apache.maven</groupId> | ||
<artifactId>banduplicate-classes-ignore-when-identical</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-enforcer-plugin</artifactId> | ||
<version>@enforcerPluginVersion@</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
<version>@project.version@</version> | ||
</dependency> | ||
</dependencies> | ||
<configuration> | ||
<rules> | ||
<BanDuplicateClasses> | ||
<ignoreWhenIdentical>true</ignoreWhenIdentical> | ||
<findAllDuplicates>true</findAllDuplicates> | ||
</BanDuplicateClasses> | ||
</rules> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>compile</phase> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-api</artifactId> | ||
<version>2.9.0</version> | ||
<scope>runtime</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-core</artifactId> | ||
<version>1.10.19</version> | ||
</dependency> | ||
|
||
<!-- these classes duplicate those in mockito-core --> | ||
<dependency> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-all</artifactId> | ||
<version>1.10.19</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
</project> |
6 changes: 6 additions & 0 deletions
6
src/it/banduplicate-classes-ignore-when-identical/verify.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
File file = new File( basedir, "build.log" ) | ||
assert file.exists() | ||
|
||
String text = file.getText( "utf-8" ) | ||
|
||
return true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.