-project dependency management tool
-build and run project
-IDE independent
Standard Directory structure:
my-project->
pom.xml
src->
main->
java
resources
webapp
test->
java
resources
target
src/main/java - java code
src/main/resorces - properties,config files
src/main/webapp - jsp,css,js,image etc
src/test - unit testing
target - compiled code by maven
pom.xml - project object model, it has
**Maven Architypes**: collection of template/started files
1. maven-architype-quickstart - normal spring core project files
2. maven-architype-webapp - have web.xml,index,jsp
Note: m2eclipse plugin should installed of maven support in eclipse
### REPOSITORY:
**1. Local repository** : c:\Users\<user-dir>\.m2\repository
**2. Central repository**: https://repo.maven.apache.org/maven2/
**3. Additional repository**: there are other 250 repositories in mvnrepository.com
-if we need dependencies from other repositories except Central we need to add respository in pom.xml
```xml
<repositories>
<repository>
<id>atlassian</id>
<name>Atlassian Repository</name>
<url>https://maven.atlassian.com/content/repositories/atlassian-public</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.atlassian.mail</groupId>
<artifactId>atlassian-mail</artifactId>
<version>4.0.4</version>
</dependency>
</dependencies>
4. Private repository: using
Archiva - archive.apache.org
Artifactory - www.jfrog.com
Nexus - www.sonatype.com
Create Java project
mvn archetype:generate
-DgroupId=org.yourcompany.project
-DartifactId=application
Create web project
mvn archetype:generate
-DgroupId=org.yourcompany.project
-DartifactId=application
-DarchetypeArtifactId=maven-archetype-webapp
Create archetype from existing project mvn archetype:create-from-project
Other Commands: