We are developing our own Eclipse plugin jars used by our Eclipse-based application. We are currently using proguard-maven-plugin
version 2.0.8 to obfuscate them. However, when running mvn install
on some plugins, we are currently encountering the following error:
[INFO] ---------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ---------------------------------------------------------------------
[INFO] Total time: 1:34.297s
[INFO] Finished at: Tue Apr 21 16:03:51 SGT 2015
[INFO] Final Memory: 88M/210M
[INFO] ---------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.wvengen:proguard-maven-plugin:2.0.8:proguard (default) on project com.x.y: Execution default of goal com.github.wvengen:proguard-maven-plugin:2.0.8:proguard failed: java.io.IOException: Cannot run program "C:\Program Files (x86)\Java\jdk1.7.0_55\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long -> [Help 1]
Has anyone ever encountered this? If so, how did you solve the problem?
Note that I have actually seen this question and other related questions before deciding to ask but the answer by Brad Mace is not applicable to my case as the "CreateProcess error=206, The filename or extension is too long" is generated by Proguard and not by Javadoc. Initially, I think (correct me if I'm wrong) that either 1 of the 7 options given by espinchi or a variation of them might work but I'm not sure which one. Just to let you know my constraints in determining the solution:
For reference, below is the Proguard-related snippet from my pom file:
<build>
<plugins>
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<maxMemory>1024m</maxMemory>
<proguardInclude>${basedir}/proguard.conf</proguardInclude>
<libs>
<lib>${java.home}/lib/rt.jar</lib>
</libs>
<exclusions>
<exclusion>
<groupId>com.company.package</groupId>
</exclusion>
</exclusions>
</configuration>
</plugin>
</plugins>
</build>
If you have a huge list of dependencies the list of -libraryjars the resulting command line to execute ProGaurd could become too long. On Windows the error message could look like CreateProcess error=206, The filename or extension is too long.
<putLibraryJarsInTempDir>true</putLibraryJarsInTempDir>
in plugin configuration makes the plugin copy all the library jars to a single temporary directory and pass that directory as the only -libraryjars argument to ProGuard. Build performance will be a bit worse, but the command line will be much shorter.
for detailed information about proguard maven plugin usage please refer their here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With