2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Apache Maven をインストールしてみた

Posted at

勉強前イメージ

javaをビルドするやつってイメージ

調査

Apache Maven とは

プロジェクトのビルドやテスト、成果物の配備など全体を管理できるツールいなります。

Apache Maven を CentOS7にインストールしてみた

  • 目次
    • 1.JDKのインストール
    • 2.ダウンロード
    • 3.パスの追加
    • 4.動作確認

1.JDKのインストール

  • JDKのインストール
yum install java-1.8.0-openjdk-devel java-1.8.0-openjdk
java -version
==========
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
==========

2.ダウンロード

  • wgetのインストール
yum install wget
  • ダウンロード
cd /opt
wget https://downloads.apache.org/maven/maven-3/3.8.1/binaries/apache-maven-3.8.1-bin.tar.gz
tar -xzvf apache-maven-3.8.1-bin.tar.gz
  • 名称変更
mv /opt/apache-maven-3.8.1 /opt/apache-maven

3.パスの追加

  • パスの確認
which java
==========
/usr/bin/java
==========
  • パスの追加
cat << "EOF" >> ~/.bash_profile
export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")
export PATH=$PATH:/opt/apache-maven/bin
EOF
  • 適応
source ~/.bash_profile

4.動作確認

  • バージョン確認
mvn --version
==========
Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: /opt/apache-maven
Java version: 1.8.0_292, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64/jre
Default locale: ja_JP, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-1160.11.1.el7.x86_64", arch: "amd64", family: "unix"
==========

勉強後イメージ

Mavenって聞いてほぼ何もわからんかったらから一旦やってみた

参考

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?