Apache Maven是一个软件项目管理和理解工具。基于项目对象模型(POM)的概念,Maven可以从中央信息管理项目的构建,报告和文档。本文介绍了如何在Ubuntu上安装apache maven。
要安装apache maven,它需要在Ubuntu上预安装Java。要验证Java版本,请使用以下命令-
$ java -version
样本输出应如下所示–
openjdk version "1.8.0_111" OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2ubuntu0.16.04.2-b14) OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)
要安装maven,请使用以下命令–
$ sudo apt-get install maven
样本输出应如下所示–
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libterm-readkey-perl linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic linux-image-4.4.0-31-generic linux-image-extra-4.4.0-31-generic linux-signed-image-4.4.0-31-generic Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: ant ant-optional junit junit4 libaopalliance-java libapache-pom-java libasm4-java libatinject-jsr330-api-java libbsh-java libcdi-api-java libcglib3-java libclassworlds-java libcommons-cli-java libcommons-codec-java libcommons-httpclient-java libcommons-io-java libcommons-lang-java libcommons-lang3-java libcommons-logging-java libcommons-net-java libcommons-net2-java libcommons-parent-java libdom4j-java libdoxia-core-java libeasymock-java libeclipse-aether-java libgeronimo-interceptor-3.0-spec-java libguava-java libguice-java libhamcrest-java libhttpclient-java libhttpcore-java libjaxen-java libjaxp1.3-java libjdom1-java libjetty-java libjsch-java libjsoup-java ............................................................................
要验证Maven版本,请使用以下命令-
$ mvn -version
样本输出应如下所示–
Apache Maven 3.3.9 Maven home: /usr/share/maven Java version: 1.8.0_111, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre Default locale: en_IN, platform encoding: UTF-8 OS name: "linux", version: "4.4.0-57-generic", arch: "amd64", family: "unix"
在这篇文章中,我们学习了一些非常有用的信息-“如何在Ubuntu上安装Apache Maven”。在我们的下一篇文章中,我们将提出更多基于Linux的技巧。继续阅读!