From 3829392d5c27527ca0dd33cadc0b8e725a80bb9e Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Mon, 18 Mar 2019 19:00:44 -0400 Subject: [PATCH] Avoid non-sensical complaint about MODULE_INFO_CLASS for mismatched minor version --- .../maven/plugins/enforcer/EnforceBytecodeVersion.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/maven/plugins/enforcer/EnforceBytecodeVersion.java b/src/main/java/org/apache/maven/plugins/enforcer/EnforceBytecodeVersion.java index 9fa2756d..bed2c810 100644 --- a/src/main/java/org/apache/maven/plugins/enforcer/EnforceBytecodeVersion.java +++ b/src/main/java/org/apache/maven/plugins/enforcer/EnforceBytecodeVersion.java @@ -349,7 +349,13 @@ private String isBadArtifact( Artifact a ) Matcher matcher = MULTIRELEASE.matcher( entry.getName() ); - if ( matcher.matches() ) + if ( MODULE_INFO_CLASS.equals( entry.getName() ) ) { + if ( major > maxJavaMajorVersionNumber ) { + getLog().warn("Invalid bytecodeVersion for " + MODULE_INFO_CLASS + ": expected " + + maxJavaMajorVersionNumber + ", but was " + major); + } + } + else if ( matcher.matches() ) { Integer expectedMajor = JDK_TO_MAJOR_VERSION_NUMBER_MAPPING.get( matcher.group( 1 ) );