Maven – Introduction

Maven Project

Download mysql connector jar
right version ???
– manual download
– version may change day wise
– manual add jars

Open source companies published jar in Maven
– auto download
– download recent version
– jars added automatically
– internet connection is required
– jars will be downloaded to local repository
NOTE: consecutive download will check in local
If not present then Maven downloads from internet

Maven Project Steps
1) Create File -> Other -> New Maven Project
2) Group id
– com.janani
3) Artifact id
– bookapp
4) Folder Structure
– src -> main -> java ( Business Logic Files ) ( it will be jar)
– src -> test -> java ( Test Files )
5) pom.xml
– group id
– artifact id
– version (major.minor.defect)
– to download recent jars from internet

1) mysql connector(C:\Users\EP\.m2\repository\mysql\mysql-connector-java\6.0.5)
2) lombok
3) commons dbcp2
4) spring-jdbc
NOTE: download from central

Downloaded Jars will be available in local repository
– C:\Users\JananiVelmurugan\.m2\repository

Maven Life Cycle
– mvn clean
– mvn compile
– mvn test
– mvn package
– mvn install

Maven Steps
– Right click project -> Run as -> maven clean

– Should able to create maven core project
– Should able to create maven web project

1) Create database and tables
2) Create a maven core project
2.1) Add maven dependencies
2.2) Add properties
2.3) Right click project -> Maven -> Update Project
2.4) Right click project -> Run as -> Maven Install
2.5) Create packages and classes in src\main\java
2.6) Create test classes in src\test\java

create xampp->htdocs-> create a new folder



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s