- Spring MVC:Beginner's Guide(Second Edition)
- Amuthan Ganeshan
- 357字
- 2021-07-14 10:49:43
Configuring a build tool
Building a java software project typically includes some activities as follows:
- Compiling all the source code
- Packaging the compiled code into a JAR or WAR archive file
- Deploying the packaged archives files on a server
Manually performing all these tasks is time-consuming and is prone to errors. Therefore, we take the help of a build tool. A build tool is a tool that automates everything related to building a software project, from compiling to deploying.
Time for action - installing the Maven build tool
There are other build tools that are available for building Java projects such as Gradle and Ant. We are going to use Maven as our build tool. Let's take a look at how we can install Maven:
- Go to Maven's download page at http://maven.apache.org/download.cgi.
- Click on the apache-maven-3.3.9-bin.zip download link and start the download.
Tip
At the time of writing this book, the latest Maven version is 3.3.9; you can literally use any version of Maven after 3.0 to complete this book.
- Once the download is finished, go to the downloaded directory and extract the
.zip
file into a convenient directory of your choice. - Now we need to create one more environment variable called
M2_HOME
in a way that is similar to the way in which we createdJAVA_HOME
. Enter the extracted Maven zip directory's path as the value for theM2_HOME
environment variable. - Finally, append the
M2_HOME
variable to thePATH
environment variable as well. Double-click on the path variable and click on the New button to enter%M2_HOME%\bin
as the value.Setting the M2 environment variable
- Now we have installed the Maven build tool in our computer. To verify whether our installation has been carried out correctly, we need to follow steps that are similar to the Java installation verification. Open a new command window, type
mvn -version
and press Enter; you will see the following details of the Maven version:C:\Users\Amuthan>mvn -version Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T10:41:47-06:00) Maven home: C:\Program Files\apache-maven-3.3.9 Java version: 1.8.0_91, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.8.0_91\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"
推薦閱讀
- 微服務(wù)設(shè)計(jì)(第2版)
- Redis Applied Design Patterns
- Getting started with Google Guava
- Moodle Administration Essentials
- SpringMVC+MyBatis快速開(kāi)發(fā)與項(xiàng)目實(shí)戰(zhàn)
- 數(shù)據(jù)結(jié)構(gòu)與算法JavaScript描述
- 教孩子學(xué)編程:C++入門(mén)圖解
- 名師講壇:Java微服務(wù)架構(gòu)實(shí)戰(zhàn)(SpringBoot+SpringCloud+Docker+RabbitMQ)
- Rust Essentials(Second Edition)
- 零基礎(chǔ)學(xué)Python網(wǎng)絡(luò)爬蟲(chóng)案例實(shí)戰(zhàn)全流程詳解(高級(jí)進(jìn)階篇)
- 計(jì)算機(jī)應(yīng)用基礎(chǔ)教程(Windows 7+Office 2010)
- Python機(jī)器學(xué)習(xí)之金融風(fēng)險(xiǎn)管理
- 零基礎(chǔ)學(xué)C語(yǔ)言程序設(shè)計(jì)
- Vue.js應(yīng)用測(cè)試
- 自學(xué)Python:編程基礎(chǔ)、科學(xué)計(jì)算及數(shù)據(jù)分析(第2版)