diff --git a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java index a027e550..a0c284f1 100644 --- a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java +++ b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java @@ -1363,12 +1363,16 @@ private void createMissingPackageInfoClasses( CompilerConfiguration compilerConf private byte[] generatePackage( CompilerConfiguration compilerConfiguration, String javaFile ) { int version = getOpcode( compilerConfiguration ); + String internalPackageName = javaFile.substring( 0, javaFile.length() - ".java".length() ); + if ( File.separatorChar != '/' ) + { + internalPackageName = internalPackageName.replace( File.separatorChar, '/' ); + } ClassWriter cw = new ClassWriter( 0 ); cw.visitSource( "package-info.java", null ); cw.visit( version, Opcodes.ACC_SYNTHETIC | Opcodes.ACC_ABSTRACT | Opcodes.ACC_INTERFACE, - javaFile.substring( 0, javaFile.length() - ".java".length() ), - null, "java/lang/Object", null ); + internalPackageName, null, "java/lang/Object", null ); return cw.toByteArray(); }