File tree 4 files changed +64
-5
lines changed
it/enforce-bytecode-version-multirelease-2
main/java/org/apache/maven/plugins/enforcer
4 files changed +64
-5
lines changed Original file line number Diff line number Diff line change
1
+ invoker.goals = enforcer:enforce
2
+ invoker.buildResult = success
Original file line number Diff line number Diff line change
1
+ <project xmlns =" http://maven.apache.org/POM/4.0.0" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
2
+ xsi:schemaLocation=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
3
+ <modelVersion >4.0.0</modelVersion >
4
+
5
+ <groupId >pim.pam.poum</groupId >
6
+ <artifactId >smoking</artifactId >
7
+ <version >1.0-SNAPSHOT</version >
8
+
9
+ <build >
10
+ <plugins >
11
+ <plugin >
12
+ <artifactId >maven-enforcer-plugin</artifactId >
13
+ <version >@enforcerPluginVersion@</version >
14
+ <dependencies >
15
+ <dependency >
16
+ <groupId >@project.groupId@</groupId >
17
+ <artifactId >@project.artifactId@</artifactId >
18
+ <version >@project.version@</version >
19
+ </dependency >
20
+ </dependencies >
21
+ <configuration >
22
+ <rules >
23
+ <enforceBytecodeVersion >
24
+ <maxJdkVersion >1.8</maxJdkVersion >
25
+ </enforceBytecodeVersion >
26
+ </rules >
27
+ </configuration >
28
+ <executions >
29
+ <execution >
30
+ <phase >compile</phase >
31
+ </execution >
32
+ </executions >
33
+ </plugin >
34
+ </plugins >
35
+ </build >
36
+ <properties >
37
+ <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
38
+ </properties >
39
+
40
+ <dependencies >
41
+ <dependency >
42
+ <groupId >com.fasterxml.jackson.module</groupId >
43
+ <artifactId >jackson-module-jaxb-annotations</artifactId >
44
+ <version >2.13.0</version >
45
+ <scope >runtime</scope >
46
+ </dependency >
47
+ </dependencies >
48
+ </project >
Original file line number Diff line number Diff line change
1
+ File file = new File ( basedir, " build.log" );
2
+ assert file. exists();
3
+
4
+ String text = file. getText(" utf-8" );
5
+
6
+ assert text. contains( ' [INFO] Adding ignore: module-info' )
7
+ assert ! text. contains( ' [WARNING] Invalid bytecodeVersion for com.fasterxml.jackson.core:jackson-core:jar:2.13.0:runtime' )
8
+
9
+ return true ;
Original file line number Diff line number Diff line change @@ -351,16 +351,16 @@ private String isBadArtifact( Artifact a )
351
351
352
352
if ( matcher .matches () )
353
353
{
354
- Integer expectedMajor = JDK_TO_MAJOR_VERSION_NUMBER_MAPPING .get ( matcher .group ( 1 ) );
354
+ Integer maxExpectedMajor = JDK_TO_MAJOR_VERSION_NUMBER_MAPPING .get ( matcher .group ( 1 ) );
355
355
356
- if (expectedMajor == null ) {
356
+ if (maxExpectedMajor == null ) {
357
357
getLog ().warn ( "Unknown bytecodeVersion for " + a + " : "
358
- + entry .getName () + ": got " + expectedMajor + " class-file-version" );
358
+ + entry .getName () + ": got " + maxExpectedMajor + " class-file-version" );
359
359
}
360
- else if ( major != expectedMajor )
360
+ else if ( major > maxExpectedMajor )
361
361
{
362
362
getLog ().warn ( "Invalid bytecodeVersion for " + a + " : "
363
- + entry .getName () + ": expected " + expectedMajor + ", but was " + major );
363
+ + entry .getName () + ": expected lower or equal to " + maxExpectedMajor + ", but was " + major );
364
364
}
365
365
}
366
366
else
You can’t perform that action at this time.
0 commit comments