Maven Tutorial
Introduction to Maven Installation and environment configuration Maven settings Standard directory structure in Maven project command line IntelliJ IDEA Super POM and Parent POM Understanding POM.xml file Declaring maven dependencies Dependency management using repositories in Maven Adding jar file as a dependency in Maven Maven archetypes Maven build life cycle, phases and goals Generating project API documentation Generating Site documentation for a project Installing artifacts in local repository Deploying the artifact on remote repository Maven plug-ins surefire plugin compiler plugin Profiles in MavenExecuting Maven phases and goals through command prompt Maven command line optionsexec-maven-plugin usage Skipping tests in Maven Test execution report in MavenCommands in Maven
In this article, we will take a look at various maven commands. To create a new maven project
mvn archetype:generate -DgroupId=”org.softpost” -DartifactId=maventut
-DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
2. To create a jar/war/ear file in Maven
mvn package
The jar/war/ear file will be put in the target folder. Depending upon the packaging tag value in POM, the specific file is created. For example – If packaging has a value as jar, jar file will be created. 3. To install a jar file in local maven repository
mvn install
4. To create a website for maven project
mvn site
5. To clean maven project
mvn clean
6. To import the maven project in to IntelliJ IDEA
mvn idea:idea
7. To import the maven project in to Eclipse
mvn eclipse:eclipse
8. To execute install goal without running tests
mvn -Dmaven.test.skip=true install
9. To compile maven project
mvn -X compile
-X switch is used to enable full debug mode. We can use it with any valid maven command. 10. To see effective POM.xml file
mvn help:effective-pom
11. To see maven dependency tree
mvn dependency:tree
12. To execute all tests in Maven project
mvn test
Web development and Automation testing
solutions delivered!!