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 bed2c810..1ba1a497 100644 --- a/src/main/java/org/apache/maven/plugins/enforcer/EnforceBytecodeVersion.java +++ b/src/main/java/org/apache/maven/plugins/enforcer/EnforceBytecodeVersion.java @@ -299,6 +299,8 @@ private String isBadArtifact( Artifact a ) jarFile = new JarFile( f ); getLog().debug( f.getName() + " => " + f.getPath() ); byte[] magicAndClassFileVersion = new byte[8]; + StringBuilder artifactInfo = new StringBuilder(); + artifactInfo.append( "(" ).append( a.getGroupId() ).append( ":" ).append( a.getArtifactId() ).append( ") " ); JAR: for ( Enumeration e = jarFile.entries(); e.hasMoreElements(); ) { JarEntry entry = e.nextElement(); @@ -351,7 +353,7 @@ private String isBadArtifact( Artifact a ) if ( MODULE_INFO_CLASS.equals( entry.getName() ) ) { if ( major > maxJavaMajorVersionNumber ) { - getLog().warn("Invalid bytecodeVersion for " + MODULE_INFO_CLASS + ": expected " + getLog().warn( artifactInfo + "Invalid bytecodeVersion for " + MODULE_INFO_CLASS + ": expected " + maxJavaMajorVersionNumber + ", but was " + major); } } @@ -365,8 +367,8 @@ else if ( matcher.matches() ) } else if ( major != expectedMajor ) { - getLog().warn( "Invalid bytecodeVersion for " + a + " : " - + entry.getName() + ": expected " + expectedMajor + ", but was " + major ); + getLog().warn( artifactInfo + "Invalid bytecodeVersion for " + entry.getName() + ": expected " + + expectedMajor + ", but was " + major ); } } else