這個問題在我確定之前已經有很多方面提出過了。我的環境Maven編譯器插件失敗?
情況:
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
和common
項目中發生故障時 **父,http://pastebin.com/p1nJaxDt **常見,http://pastebin.com/KQh88RBM
這裏有一些我覈實了我的環境...
[[email protected] workspace]$ set | grep JAVA
JAVA=/usr/java/jdk1.6.0_45/bin
JAVA_HOME=/usr/java/jdk1.6.0_45
[[email protected] 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"
[[email protected] 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)
[[email protected] workspace]$ javac -version
javac 1.6.0_45
[[email protected] workspace]$ which java
/usr/java/jdk1.6.0_45/bin/java
[[email protected] 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"))
[[email protected] workspace]$ uname -r
3.11.1-200.fc19.x86_64
[[email protected] workspace]$
UPDATE 我想我的問題可能是關於Maven的編譯器插件,但我不能排除環境配置。如你所見,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 = [email protected]
[DEBUG] (f) session = [email protected]
[DEBUG] -- end configuration --
[DEBUG] Using compiler 'javac'.
[DEBUG] Source directories: [/var/lib/jenkins/jobs/ETSE(3.0.x)-JavaProjects/workspace/common/src/main/java]
發佈你的'pom.xml'和'mvn -X'的實際輸出。 – chrylis
我的'pom.xml'非常龐大。你在尋找maven-compiler-plugin的輸出是什麼? –
我的maven爲我做了同樣的事情。 JDK使用JRE來運行。 JDK是JRE以及一個編譯器和工具。 –