gpt4 book ai didi

java - 执行proguard-maven-plugin时出现 "CreateProcess error=206, The filename or extension is too long"

转载 作者:搜寻专家 更新时间:2023-10-30 20:54:29 32 4
gpt4 key购买 nike

我们正在开发我们自己的 Eclipse 插件 jar,供我们基于 Eclipse 的应用程序使用。我们目前正在使用 proguard-maven-plugin 版本 2.0.8 来混淆它们。但是,在某些插件上运行 mvn install 时,我们目前遇到以下错误:

[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]

有人遇到过这种情况吗?如果是,您是如何解决问题的?

请注意,我实际上已经看到了this question在决定提问之前以及其他相关问题,但 Brad Mace 的回答不适用于我的情况,因为“CreateProcess error=206,文件名或扩展名太长”是由 Proguard 而不是 Javadoc 生成的。最初,我认为(如果我错了请纠正我)espinchi 给出的 7 个选项中的任何一个或它们的变体都可能有效,但我不确定是哪一个。只是为了让您知道我在确定解决方案时的局限性:

  1. 我不确定这个特定插件中的所有类路径是否有效,因为这是由其他人开发多年的之前,所以我认为我仍然无法联系开发人员。这使得我犹豫要不要减少类路径,因为担心它实际上可能弊大于利。
  2. 我无法使用“使用 IntelliJ”选项的开关,因为在执行 mvn 安装时,这个问题发生在 Windows 命令行上而不是在 Eclipse IDE 中。
  3. 我认为其他选项对我来说太乏味了。我希望有一个更简单的解决方案。

作为引用,下面是我的 pom 文件中与 Proguard 相关的片段:

<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>

最佳答案

如果您有大量的依赖项列表,那么执行 ProGaurd 的 -libraryjars 列表可能会变得太长。在 Windows 上,错误消息可能类似于 CreateProcess error=206,文件名或扩展名太长。

<putLibraryJarsInTempDir>true</putLibraryJarsInTempDir>

在插件配置中,使插件将所有库 jar 复制到一个临时目录,并将该目录作为唯一的 -libraryjars 参数传递给 ProGuard。构建性能会差一点,但命令行会短得多。

有关 proguard maven 插件使用的详细信息,请参阅他们的 here

关于java - 执行proguard-maven-plugin时出现 "CreateProcess error=206, The filename or extension is too long",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29767073/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com