-
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.
Add strict option to EnforceBytecodeVersion to not ignore module-info…
… and Multi-Release JAR classes
- Loading branch information
1 parent
c795041
commit a41a85d
Showing
11 changed files
with
214 additions
and
9 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
src/it/enforce-bytecode-version-module-info-jdk8-strict/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 |
51 changes: 51 additions & 0 deletions
51
src/it/enforce-bytecode-version-module-info-jdk8-strict/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,51 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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>pim.pam.poum</groupId> | ||
<artifactId>smoking</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.ow2.asm</groupId> | ||
<artifactId>asm</artifactId> | ||
<version>6.0</version> | ||
<scope>runtime</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<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> | ||
<enforceBytecodeVersion> | ||
<maxJdkVersion>1.8</maxJdkVersion> | ||
<strict>true</strict> | ||
</enforceBytecodeVersion> | ||
</rules> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>compile</phase> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
9 changes: 9 additions & 0 deletions
9
src/it/enforce-bytecode-version-module-info-jdk8-strict/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,9 @@ | ||
File file = new File( basedir, "build.log" ); | ||
assert file.exists(); | ||
|
||
String text = file.getText("utf-8"); | ||
|
||
assert ! text.contains( '[INFO] Adding ignore: module-info' ) | ||
assert text.contains( 'Found Banned Dependency: org.ow2.asm:asm:jar:6.0' ) | ||
|
||
return true; |
2 changes: 2 additions & 0 deletions
2
src/it/enforce-bytecode-version-module-info-jdk9-strict/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 |
51 changes: 51 additions & 0 deletions
51
src/it/enforce-bytecode-version-module-info-jdk9-strict/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,51 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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>pim.pam.poum</groupId> | ||
<artifactId>smoking</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.ow2.asm</groupId> | ||
<artifactId>asm</artifactId> | ||
<version>6.0</version> | ||
<scope>runtime</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<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> | ||
<enforceBytecodeVersion> | ||
<maxJdkVersion>1.9</maxJdkVersion> | ||
<strict>true</strict> | ||
</enforceBytecodeVersion> | ||
</rules> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>compile</phase> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
9 changes: 9 additions & 0 deletions
9
src/it/enforce-bytecode-version-module-info-jdk9-strict/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,9 @@ | ||
File file = new File( basedir, "build.log" ); | ||
assert file.exists(); | ||
|
||
String text = file.getText("utf-8"); | ||
|
||
assert ! text.contains( '[INFO] Adding ignore: module-info' ) | ||
assert ! text.contains( 'Found Banned Dependency: org.ow2.asm:asm:jar:6.0' ) | ||
|
||
return true; |
2 changes: 2 additions & 0 deletions
2
src/it/enforce-bytecode-version-multirelease-strict/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 |
54 changes: 54 additions & 0 deletions
54
src/it/enforce-bytecode-version-multirelease-strict/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,54 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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>pim.pam.poum</groupId> | ||
<artifactId>smoking</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-api</artifactId> | ||
<version>2.17.2</version> | ||
<scope>runtime</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<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> | ||
<enforceBytecodeVersion> | ||
<maxJdkVersion>1.8</maxJdkVersion> | ||
<strict>true</strict> | ||
</enforceBytecodeVersion> | ||
</rules> | ||
</configuration> | ||
|
||
<executions> | ||
<execution> | ||
<phase>compile</phase> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
9 changes: 9 additions & 0 deletions
9
src/it/enforce-bytecode-version-multirelease-strict/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,9 @@ | ||
File file = new File( basedir, "build.log" ); | ||
assert file.exists(); | ||
|
||
String text = file.getText("utf-8"); | ||
|
||
assert ! text.contains( '[INFO] Adding ignore: module-info' ) | ||
assert text.contains( 'Found Banned Dependency: org.apache.logging.log4j:log4j-api:jar:2.17.2' ) | ||
|
||
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
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