maven 无法在 ubuntu 14.0.4 上更新

maven 无法在 ubuntu 14.0.4 上更新

我目前有 3.0.5 版本的 maven,当我运行

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,但我希望在这里得到快速回复。谢谢!

答案1

我遵循了这里的建议如何更新 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=$M2:$PATH

相关内容