Java:
Exception in thread "main" java.lang.IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/annotation-4.0.0.jar
Ich habe mein Program über maven mit YGuard obfuscatet.
Code:
<
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>package.App</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<id>obfuscate</id>
<configuration>
<tasks>
<property name="runtime_classpath"
refid="maven.runtime.classpath" />
<taskdef name="yguard"
classname="com.yworks.yguard.YGuardTask"
classpath="${runtime_classpath}" />
<yguard>
<inoutpair
in="${project.build.directory}/${project.build.finalName}.jar"
out="${project.build.directory}/${project.build.finalName}_obfuscated.jar" />
<attribute name="Deprecated" />
<rename mainclass="package.App"
logfile="${project.build.directory}/yguard.log.xml">
<keep>
<method class="package.App"
name="void main(java.lang.String[])" />
<class classes="protected"
methods="protected"
fields="protected" />
</keep>
</rename>
</yguard>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Und wenn ich meine Obfuscated.jar ausführen möchte bekomme ich diese Fehlermledung:
Code:
Exception in thread "main" java.lang.IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/annotation-4.0.0.jar
at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(Unknown Source)
at org.springframework.boot.loader.archive.JarFileArchive$_B.B(Unknown Source)
at org.springframework.boot.loader.archive.JarFileArchive$_B.A(Unknown Source)
at org.springframework.boot.loader.archive.JarFileArchive$_D.next(Unknown Source)
at org.springframework.boot.loader.PropertiesLauncher$_A.B(Unknown Source)
at org.springframework.boot.loader.PropertiesLauncher$_A.<init>(Unknown Source)
at org.springframework.boot.loader.PropertiesLauncher.getClassPathArchivesIterator(Unknown Source)
at org.springframework.boot.loader.Launcher.launch(Unknown Source)
at org.springframework.boot.loader.PropertiesLauncher.main(Unknown Source)
Caused by: java.io.IOException: Unable to open nested jar file 'BOOT-INF/lib/annotation-4.0.0.jar'
at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(Unknown Source)
at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(Unknown Source)
... 9 more
Caused by: java.lang.IllegalStateException: Unable to open nested entry 'BOOT-INF/lib/annotation-4.0.0.jar'. It has been compressed and nested jar files must be stored without compression. Please check the mechanism used to create your executable jar file
Leider konnte ich im internet nichts hilfreiches finden.