在我确定之前,已经以多种方式提出了这个问题。
我的环境细节:
Fedora 19
Oracle JDK 6u45
(根据http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-6-on-fedora-centos-red-hat-rhel/安装)Maven 3.0.5
(从 .zip 解压到 /opt/apache-maven-3.0.5)
以下提交审核(太大,无法在此处粘贴和格式化):
- 从构建尝试中控制台出来
mvn -e
,http ://pastebin.com/qmNKVYjH - 发生故障的项目和项目的
pom.xml
文件** parent, http ://pastebin.com/p1nJaxDt ** common,http ://pastebin.com/KQh88RBMparent
common
以下是我验证的关于我的环境的一些事情......
[jenkins@lx64etseapp04 workspace]$ set | grep JAVA
JAVA=/usr/java/jdk1.6.0_45/bin
JAVA_HOME=/usr/java/jdk1.6.0_45
[jenkins@lx64etseapp04 workspace]$ mvn -version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 05:51:28-0800)
Maven home: /opt/apache-maven-3.0.5
Java version: 1.6.0_45, vendor: Sun Microsystems Inc.
Java home: /usr/java/jdk1.6.0_45/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.11.1-200.fc19.x86_64", arch: "amd64", family: "unix"
[jenkins@lx64etseapp04 workspace]$ java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
[jenkins@lx64etseapp04 workspace]$ javac -version
javac 1.6.0_45
[jenkins@lx64etseapp04 workspace]$ which java
/usr/java/jdk1.6.0_45/bin/java
[jenkins@lx64etseapp04 workspace]$ set | grep PATH
PATH=/usr/java/jdk1.6.0_45/bin:/opt/TEE-CLC-11.0.0:/opt/apache-maven-3.0.5/bin: /usr/java/jdk1.6.0_45/bin:/opt/apache-ant-1.9.2/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/var/lib/jenkins/.local/bin:/var/lib/jenkins/bin
QT_PLUGIN_PATH=/usr/lib64/kde4/plugins:/usr/lib/kde4/plugins
local cmd PATH=$PATH:/sbin;
if [[ -z "${CDPATH:-}" || "$cur" == ?(.)?(.)/* ]]; then
for i in ${CDPATH//:/'
PATH=$PATH:/usr/sbin:/sbin:/usr/local/sbin type $1 &>/dev/null
COMPREPLY=($( compgen -W "$( PATH="$PATH:/sbin" lsmod | awk '{if (NR != 1) print $1}' )" -- "$1" ))
local PATH=$PATH:/sbin;
local PATH="$PATH:/sbin:/usr/sbin";
COMPREPLY+=($( compgen -W "$( PATH="$PATH:/sbin" lspci -n | awk '{print $3}')" -- "$cur" ))
local PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin;
COMPREPLY+=($( compgen -W "$( PATH="$PATH:/sbin" lsusb | awk '{print $6}' )" -- "$cur" ))
[jenkins@lx64etseapp04 workspace]$ uname -r
3.11.1-200.fc19.x86_64
[jenkins@lx64etseapp04 workspace]$
更新 我认为我的问题可能与 maven-compiler-plugin 有关,但我不能排除环境配置。如上所示,maven-compiler-plugin 失败。
为什么 Maven 说它想使用 JRE 而不是 JDK? JDK确实安装了!
这是一些mvn -X
输出...
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-compiler-plugin:3.1:compile from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-compiler-plugin:3.1, parent: $
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-compiler-plugin:3.1:compile' with basic configurator -->
[DEBUG] (f) basedir = /var/lib/jenkins/jobs/ETSE(3.0.x)-JavaProjects/workspace/common
[DEBUG] (f) buildDirectory = /var/lib/jenkins/jobs/ETSE(3.0.x)-JavaProjects/workspace/common/target
[DEBUG] (f) classpathElements = [/var/lib/jenkins/jobs/ETSE(3.0.x)-JavaProjects/workspace/common/target/classes, /var/lib/jenkins/.m2/repository/com/etp/commons/commons-log-persi$
[DEBUG] (f) compileSourceRoots = [/var/lib/jenkins/jobs/ETSE(3.0.x)-JavaProjects/workspace/common/src/main/java]
[DEBUG] (f) compilerArgument = -Xlint:all
[DEBUG] (f) compilerId = javac
[DEBUG] (f) compilerVersion = 1.6
[DEBUG] (f) debug = true
[DEBUG] (f) encoding = UTF-8
[DEBUG] (f) failOnError = true
[DEBUG] (f) forceJavacCompilerUse = false
[DEBUG] (f) fork = true
[DEBUG] (f) generatedSourcesDirectory = /var/lib/jenkins/jobs/ETSE(3.0.x)-JavaProjects/workspace/common/target/generated-sources/annotations
[DEBUG] (f) maxmem = 512m
[DEBUG] (f) meminitial = 128m
[DEBUG] (f) mojoExecution = org.apache.maven.plugins:maven-compiler-plugin:3.1:compile {execution: default-compile}
[DEBUG] (f) optimize = false
[DEBUG] (f) outputDirectory = /var/lib/jenkins/jobs/ETSE(3.0.x)-JavaProjects/workspace/common/target/classes
[DEBUG] (f) projectArtifact = com.etse:etse-common:jar:3.0.3-SNAPSHOT
[DEBUG] (f) showDeprecation = true
[DEBUG] (f) showWarnings = true
[DEBUG] (f) skipMultiThreadWarning = false
[DEBUG] (f) source = 1.6
[DEBUG] (f) staleMillis = 0
[DEBUG] (f) target = 1.6
[DEBUG] (f) useIncrementalCompilation = true
[DEBUG] (f) verbose = true
[DEBUG] (f) mavenSession = org.apache.maven.execution.MavenSession@2df30035
[DEBUG] (f) session = org.apache.maven.execution.MavenSession@2df30035
[DEBUG] -- end configuration --
[DEBUG] Using compiler 'javac'.
[DEBUG] Source directories: [/var/lib/jenkins/jobs/ETSE(3.0.x)-JavaProjects/workspace/common/src/main/java]