- “MAVEN” Projects provides best structure for Java development.
- Apache Maven can be downloaded from link:-
http://maven.apache.org/download.cgi
- The settings for Maven projects are present in “settings.xml“.
- settings.xml contains setting for repository such as location,authentication.
- Here Drive ‘Em2repo’ contains all dependency jar file that is downloaded.
- Maven Web Project Structure(WAR ARCHETYPE),
- pom.xml contains following dependencies,
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sandeep.maven.web</groupId>
<artifactId>MavenWebApp</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>MavenWebApp Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>MavenWebApp</finalName>
</build>
</project>
- To Run Maven Clean/Install these following options,
- Run Configuration options clean and package,
- Run Will generate following messages in Console,
- It will generate war file in target folder MavenWebApp.war,