maven - directdevops.blog · hello world maven project (contd..) execute mvn clean in command...

22
Maven

Upload: others

Post on 10-Aug-2020

18 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it

Maven

Page 2: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it
Page 3: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it
Page 4: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it
Page 5: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it

How To Install Maven ?1.https://maven.apache.org/install.html

2.Installing Maven using apt-get

“https://www.mkyong.com/maven/how-to-install-maven-in-

ubuntu/”

3.Installing maven on Centos / Redhat family

https://tecadmin.net/install-apache-maven-on-centos/

4. To install Java follow

https://www.digitalocean.com/community/tutorials/how-to-

install-java-on-ubuntu-with-apt-get

https://www.digitalocean.com/community/tutorials/how-to-

install-java-on-centos-and-fedora

Page 6: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it

Hello WorlD Maven Project● Create a new folder (Directory) called hello-world

● Navigate with hello-world and create a file called

pom.xml

Page 7: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it

Hello World MAVEN PROJECT (CONTD..)● Edit pom.xml with following contents

Page 8: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it

Hello World MAVEN PROJECT (CONTD..)● Create folder src/main/java

● Create a file HelloWorld.java with following contents

● Navigate to the folder containing pom.xml file

Page 9: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it

Hello World MAVEN PROJECT (CONTD..)● Execute mvn clean in command line/Terminal. If you are

running for first time maven downloads bunch of plugins &

it take some time

● Execute mvn compile in terminal. This will compile the

java code and show you compile errors if any. If the

compile is success, it will copy the class files to

target\classes

Page 10: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it

Hello World MAVEN PROJECT (CONTD..)● Execute mvn package to perform packaging & create jar

file in target folder . The jar files name will be

<artifactid>-<version>.<packaging type>

Page 11: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it

STRUCTURE OF MAVEN

Page 12: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it
Page 13: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it

FOLDER STRUCTURE

Page 14: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it

Folder Structure

Page 15: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it

FOLDER STRUCTURE

Page 16: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it

FolDER STRUCTURE

Page 17: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it
Page 18: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it
Page 19: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it
Page 20: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it
Page 21: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it
Page 22: Maven - directdevops.blog · Hello World MAVEN PROJECT (CONTD..) Execute mvn clean in command line/Terminal. If you are running for first time maven downloads bunch of plugins & it