[英]Proguard Obfuscation failed in Jenkins build using Maven - can't read classes.jar
I'm using Jenkins to build a Maven project on a Linux box and getting the following error: 我正在使用Jenkins在Linux机器上构建Maven项目,并收到以下错误:
[proguard] Error: Can't read [/usr/lib/jvm/java-6-openjdk-amd64/Classes/classes.jar] (No such file or directory)
[proguard]错误:无法读取[/usr/lib/jvm/java-6-openjdk-amd64/Classes/classes.jar](没有此类文件或目录)
I have installed JDK and set the JAVA_HOME variable to: /usr/lib/jvm/java-6-openjdk-amd64 我已经安装了JDK并将JAVA_HOME变量设置为:/ usr / lib / jvm / java-6-openjdk-amd64
However, if I take a look at the 'System Information' section of Jenkins I get two locations for java home: 但是,如果我看一下Jenkins的“系统信息”部分,则会得到两个Java主目录位置:
java.home: /usr/lib/jvm/java-6-openjdk-amd64/jre
java.home:/ usr / lib / jvm / java-6-openjdk-amd64 / jre
JAVA_HOME: /usr/lib/jvm/java-6-openjdk-amd64
JAVA_HOME:/ usr / lib / jvm / java-6-openjdk-amd64
When I run the project on MacOS the proguard plugin works perfectly so I know it has nothing to do with my project setup. 当我在MacOS上运行项目时,proguard插件可以完美运行,因此我知道它与我的项目设置无关。 Something I'm missing in Jenkins or how Java is installed on my Server?
Jenkins缺少的内容或服务器上如何安装Java?
You are using proguard plugin? 您正在使用proguard插件吗? Did you include the following in pom.xml?
您是否在pom.xml中添加了以下内容?
<libs>
<lib>${java.home}/Classes/classes.jar</lib>
</libs>
I guess, your development env is a mac box, and your jenkins is running in a linux box. 我想,您的开发环境是mac机,而您的jenkins在linux机中运行。 So that's the problem.
这就是问题所在。
The following settings could work in linux. 以下设置可以在Linux中使用。 And if you install Oracle Jdk 1.7 or 1.8 in mac, it will also ok.
而且,如果您在Mac中安装Oracle Jdk 1.7或1.8,也可以。
<libs>
<lib>${java.home}/lib/rt.jar</lib>
</libs>
My point is that the key of the problem is that the libs setting is from mac working with apple java6, and the jenkins is on linux. 我的观点是,问题的关键在于libs设置来自Mac与Apple java6一起使用,而jenkins位于Linux上。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.