When I set the filename of the output jar file to something other than ${project.build.finalName}.jar, a simple Hello World project compiles and runs with no issue.
<plugin>
<groupId>com.jolira</groupId>
<artifactId>onejar-maven-plugin</artifactId>
<version>${plugin.version.onejar-maven-plugin}</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<mainClass>${mainClass}</mainClass>
<attachToBuild>true</attachToBuild>
<filename>${project.build.finalName}-test.jar</filename>
</configuration>
<goals>
<goal>one-jar</goal>
</goals>
</execution>
</executions>
</plugin>
Unable to load resource: java.io.EOFException: Unexpected end of ZLIB input stream
java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:240)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at java.util.zip.ZipInputStream.read(ZipInputStream.java:194)
at java.util.jar.JarInputStream.read(JarInputStream.java:207)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at com.simontuffs.onejar.JarClassLoader.copy(JarClassLoader.java:1214)
at com.simontuffs.onejar.JarClassLoader.loadBytes(JarClassLoader.java:580)
at com.simontuffs.onejar.JarClassLoader.loadByteCode(JarClassLoader.java:542)
at com.simontuffs.onejar.JarClassLoader.load(JarClassLoader.java:452)
at com.simontuffs.onejar.JarClassLoader.load(JarClassLoader.java:338)
at com.simontuffs.onejar.Boot.run(Boot.java:322)
at com.simontuffs.onejar.Boot.main(Boot.java:166)
Exception in thread "main" java.lang.ClassNotFoundException: com.nyefan.Main
at com.simontuffs.onejar.JarClassLoader.findClass(JarClassLoader.java:713)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at com.simontuffs.onejar.JarClassLoader.loadClass(JarClassLoader.java:630)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.simontuffs.onejar.Boot.run(Boot.java:334)
at com.simontuffs.onejar.Boot.main(Boot.java:166)