maven没有在ubuntu 14.0.4上更新

时间:2016-06-12 07:32:52

标签: maven build ubuntu-14.04 maven-3 upgrade

当我运行

时,我目前拥有maven版本3.0.5
mvn -version 

我得到了

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option 
MaxPermSize=1024m; support was removed in 8.0
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.8.0_65, vendor: Oracle Corporation
Java home: /usr/java/latest/jdk1.8.0_65/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.19.0-61-generic", arch: "amd64", family: "unix"

但是当我尝试构建某些内容时,它正在寻找更高版本。以下是构建apache zeppelin时出现的错误

[INFO] Zeppelin .......................................... SUCCESS [23.707s]
[INFO] Zeppelin: Interpreter ............................. SUCCESS [12.301s]
[INFO] Zeppelin: Zengine ................................. SUCCESS [5.654s]
[INFO] Zeppelin: Display system apis ..................... SUCCESS [18.403s]
[INFO] Zeppelin: Spark dependencies ...................... SUCCESS [46.644s]
[INFO] Zeppelin: Spark ................................... SUCCESS [22.427s]
[INFO] Zeppelin: Markdown interpreter .................... SUCCESS [0.467s]
[INFO] Zeppelin: Angular interpreter ..................... SUCCESS [0.398s]
[INFO] Zeppelin: Shell interpreter ....................... SUCCESS [0.392s]
[INFO] Zeppelin: Hive interpreter ........................ SUCCESS [3.598s]
[INFO] Zeppelin: HBase interpreter ....................... SUCCESS [6.213s]
[INFO] Zeppelin: Apache Phoenix Interpreter .............. SUCCESS [4.489s]
[INFO] Zeppelin: PostgreSQL interpreter .................. SUCCESS [0.774s]
[INFO] Zeppelin: JDBC interpreter ........................ SUCCESS [0.619s]
[INFO] Zeppelin: Tajo interpreter ........................ SUCCESS [1.516s]
[INFO] Zeppelin: File System Interpreters ................ SUCCESS [1.382s]
[INFO] Zeppelin: Flink ................................... SUCCESS [10.273s]
[INFO] Zeppelin: Apache Ignite interpreter ............... SUCCESS [1.636s]
[INFO] Zeppelin: Kylin interpreter ....................... SUCCESS [0.397s]
[INFO] Zeppelin: Lens interpreter ........................ SUCCESS [3.718s]
[INFO] Zeppelin: Cassandra ............................... SUCCESS [55.579s]
[INFO] Zeppelin: Elasticsearch interpreter ............... SUCCESS [2.541s]
[INFO] Zeppelin: Alluxio interpreter ..................... SUCCESS [2.759s]
[INFO] Zeppelin: web Application ......................... FAILURE [0.328s]
[INFO] Zeppelin: Server .................................. SKIPPED
[INFO] Zeppelin: Packaging distribution .................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3:47.114s
[INFO] Finished at: Sun Jun 12 07:16:37 UTC 2016
[INFO] Final Memory: 157M/1106M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.25:install-node-and-npm (install node and npm) on project zeppelin-web: The plugin com.github.eirslett:frontend-maven-plugin:0.0.25 requires Maven version 3.1.0 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginIncompatibleException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :zeppelin-web

所以我可以让maven获得前端插件的特定版本,我可能最终会这样做,或者我可以更新maven。所以,我决定更新maven并运行命令

sudo apt-get --only-upgrade install maven

作为回应,我得到

Reading package lists... Done
Building dependency tree       
Reading state information... Done
maven is already the newest version.

解决这个问题的最佳方法是什么?我正在考虑卸载maven,但我希望能在这里做出快速反应。谢谢!

2 个答案:

答案 0 :(得分:2)

问题是apt中最新版本的maven是3.0.5 您可以使用以下命令在Ubuntu 14.04中升级您的maven -

sudo apt-get purge maven maven2 maven3
sudo apt-add-repository ppa:andrei-pozolotin/maven3
sudo apt-get update
sudo apt-get install maven3

这将帮助您安装更高版本的maven。 我注意到你正在尝试使用maven安装zeppelin。我亲自尝试过,即使在成功构建之后,Zeppelin在我的情况下也无法正常工作。我建议你试试“z manager”。您可以搜索它或只需键入以下命令

curl -fsSL https://raw.githubusercontent.com/NFLabs/z-manager/master/zeppelin-installer.sh | bash

Z-Manager具有简单的交互式命令行界面。但是只支持有限版本的hadoop和spark。检查一下。如果您的配置受支持,那么请务必将其签出。

答案 1 :(得分:1)

我遵循了https://askubuntu.com/questions/420281/how-to-update-maven-3-0-4-3-1-1的建议,这基本上是

cd ~/Downloads
wget http://apache.mirrors.tds.net/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.tar.gz

sudo mkdir -p /usr/local/apache-maven
sudo mv apache-maven-3.1.1-bin.tar.gz /usr/local/apache-maven
cd /usr/local/apache-maven
sudo tar -xzvf apache-maven-3.1.1-bin.tar.gz
Edit ~/.profile with gedit ~/.profile and add these four lines:

export M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1
export M2=$M2_HOME/bin
export MAVEN_OPTS="-Xms256m -Xmx512m"
export PATH=/usr/local/apache-maven/apache-maven-3.1.1/bin