Apache Maven, is an innovative software project management tool, provides new concept of a project object model (POM) file to manage project’s build, dependency and documentation. The most powerful feature is able to download the project dependency libraries automatically.
In this tutorials, it provides many step by step examples and explanations on using Apache Maven 2.x.
Happy learning Maven. :)
Maven Installation & Configuration
Installation guide on Windows and Ubuntu.
- Install Maven on Windows
Article about how to install Maven on Windows.
- Install Maven on Ubuntu
Article about how to install on Ubuntu.
- Enable proxy access in Maven
To use proxy server to connect internet, you have to configure the proxy setting in Maven.
Maven local, central and remote repository configuration and explanation, some terms you may need to understand before use Maven.
- What is Maven local repository
Maven local repository is used to store the project dependency libraries, and the default folder is “.m2″, you may need to change it to another folder.
- What is Maven central repository
Maven central repository is the default location for Maven to download all the project dependency libraries.
- What is Maven remote repository, and how to configure it
Not all libraries are store in Maven central repository, often times, you need to add some remote repositories to download the libraries from another location instead of the default central repository.
- Maven library dependency explanation
Article about the different of dependency library in tradition way and Maven way, and explains where Maven will search those library.
- Install custom library into Maven local repository
Many libraries are still not support Maven pom.xml concept, here’s a guide to show how to include the “non-maven-support” library into Maven local repository.
Maven based project and Eclipse IDE
Examples to create Java project and web application with Maven, and how to import it into Eclipse IDE.
- Create a Java project with Maven
Uses Maven to create a Java project.
- Convert Maven based Java project to support Eclipse IDE
Guide to convert Maven based Java project to support Eclipse IDE.
- Create a Web Application Project with Maven
Uses Maven to create a Web Application Project.
- Convert Maven based web application to support Eclipse IDE
Guide to convert Maven based web application to support Eclipse IDE.
- Create a project with Maven template
Alternatively, you can create a standard project from Maven templete.
- Convert existing Java web project to Maven based project
Guide to convert existing Java web project to Maven based web application project, and support Eclipse IDE.
Maven Basic Operations
Some basic operations, compile, build, unit test, install, generate site and deploy your Maven based project.
- How to build project with Maven
“mvn package” to build project.
- How to clean project with Maven
“mvn clean” to clean project.
- How to run unit test with Maven
“mvn test” to run unit test.
- How to install your project into Maven local repository
“mvn install” to package and deploy project to local repository.
- How to generate a documentation site for your Maven based project
“mvn site” to generate documentation site for your project information.
- How to deploy site with “mvn site-deploy” – WebDAV example
“mvn site-deploy” to deploy generated documentation site to server automatically, via WebDAV.
- How to deploy Maven based war file to Tomcat
“mvn tomcat:deploy” to deploy WAR file to Tomcat.
Some common Maven FAQs.
- Add M2_REPO classpath variable to Eclipse IDE
To make your Maven project support Eclipse IDE, you need to add this M2_REPO classpath variable.
- How to display Maven plugin goals and parameters
Use Maven to diplsay all available goals and parametera of a plugin.
- Integrate Maven with Eclipse via External Tool Configuration
How to integrate Maven with Eclipse IDE.
- Skip unit test during Maven build
Tip to skip running your unit test in Maven.
- Change Maven resources folder location
A guide to show how to add another resource folder to your Maven’s project.
- Search Maven coordinates (dependency) with Google
How do you know the library Maven coordinate? Search it folder by folder on Maven repository? Here’s a tip to use Google site search to get the Maven coordinate from Maven repository.
- Create Ant build file from Maven pom.xml
A plugin to generate Ant build file (build.xml) from Maven’s pom.xml file.
- Generate source code jar for Maven based project
Uses “maven-source-plugin” to pack your source code and deploy along with your project.
- Generate javadoc jar for Maven based project
Uses “maven-javadoc-plugin” to generate javadoc jar and deploy along with your project.
- Download J2EE API (javaee.jar) via Maven
- Download JavaMail API via Maven
- Download standard.jar (taglib) & jstl.jar via Maven
Some common error messages in Maven.
- Maven dependency libraries not deploy in Eclipse IDE
- Unsupported WTP version: 1.5
- Annotations are not supported in -source 1.3
- Tomcat deploy Maven project web.xml to a wrong folder in Eclipse
- Maven + WebDAV – Embedded error: Failed to transfer file: … Return code is: 405