Skip to content

Commit 8394872

Browse files
committed
document mitigation strategies module and enforcer plugin
1 parent 01a394a commit 8394872

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

java/maven/abstract-project/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,28 @@ The concept is to seal `postgresql` jar.
121121
java.lang.SecurityException: sealing violation: package org.postgresql is
122122
sealed
123123
```
124+
125+
### Java Modules
126+
127+
See https://github.com/FredBonux/class-hijack-poc/tree/mitigation-module
128+
129+
The packaging of victim application will fail.
130+
131+
### Maven Enforcer Plugin
132+
133+
Using any of the above packaging techniques with profile `enforcer` and
134+
expect a build failure.
135+
Example:
136+
```shell
137+
mvn clean package -Passembly,enforcer
138+
```
139+
```text
140+
[ERROR] Rule 0: org.codehaus.mojo.extraenforcer.dependencies.BanDuplicateClasses failed with message:
141+
[ERROR] Duplicate classes found:
142+
[ERROR]
143+
[ERROR] Found in:
144+
[ERROR] dev.scored:D11:jar:1.0.0:compile
145+
[ERROR] org.postgresql:postgresql:jar:42.7.7:compile
146+
[ERROR] Duplicate classes:
147+
[ERROR] org/postgresql/Driver.class
148+
```

0 commit comments

Comments
 (0)