Maven 2 was a major redesign of Maven 1. This guide focuses on the differences that mattered to build engineers: compatibility, repository configuration, lifecycle behavior, and multi-project execution.
Originally published on 2010-04-14; fully revised and updated.

Maven 1 vs Maven 2 at a glance
According to the original Maven documentation and migration notes, Maven 2 was a complete rewrite of Maven 1 and not backward-compatible with Maven 1 plugins. It also shifted teams toward a stronger POM-and-lifecycle model.
| Aspect | Maven 1 | Maven 2 | Why it matters |
|---|---|---|---|
| Core implementation | Original Maven codebase | Complete rewrite | Different internals and behavior |
| Plugin compatibility | Maven 1 plugins | Cannot execute Maven 1 plugins | Migration may require plugin replacement |
| Build customization | Commonly used scripting patterns (for example maven.xml) | Plugin-centric extension model | Less ad-hoc scripting, more structured plugins |
| Configuration style | Heavier properties-file usage | Project config in pom.xml; private/user settings in settings.xml | Cleaner separation of project and environment concerns |
| Multi-project handling | Supported via plugin | Native parent/child multi-project support | Better large-project orchestration |
Repository configuration differences
The original post showed two different repository approaches: Maven 1 via properties, and Maven 2 via repository definitions with a legacy layout.
Maven 1 style (project.properties or build.properties)
maven.repo.remote=http://download.java.net/maven/1/,http://www.ibiblio.org/maven/Code language: JavaScript (javascript)
Maven 2 style (pom.xml repository with legacy layout)
<repositories>
<repository>
<id>java.net</id>
<url>http://download.java.net/maven/1</url>
<layout>legacy</layout>
</repository>
</repositories>Code language: HTML, XML (xml)
The source also notes that Maven 2 introduced settings.xml for environment-specific and private configuration (such as credentials), while project behavior belongs in pom.xml.
Maven 2 lifecycle workflow
A key change in Maven 2 was the stronger lifecycle model. Running a later phase triggers earlier phases in sequence.
flowchart TD
A[mvn clean install] --> B[Clean output directory]
B --> C[Compile source]
C --> D[Run unit tests]
D --> E[Package artifact]
E --> F[Install in local repository]
F --> G{Run mvn deploy?}
G -- yes --> H[Publish to remote repository]
G -- no --> I[Build complete]
- compile: compile source code
- test: run unit tests
- package: create distributable artifact (for example JAR or WAR)
- integration-test: execute integration testing workflow
- install: install artifact in local repository
- deploy: publish artifact to remote repository
# Common Maven 2 era usage
mvn clean install
mvn deploy
# Historical syntax seen in early Maven 2 docs
m2 clean:clean installCode language: PHP (php)
Multi-project support and project layout
The source emphasizes Maven 2’s native multi-project execution with parent descriptors. Invoking a lifecycle from the parent can orchestrate child modules as part of one build.
root/
pom.xml
src/
main/
java/
com/daviddewolf/maven/example/App.java
test/
java/
com/daviddewolf/maven/example/TestApp.java
The original article used the following project bootstrap command:
m2 archetype:create -DgroupId=com.daviddewolf.maven -DartifactId=example
Legacy Maven 2 goals frequently referenced
These goals were listed in the original post as commonly useful in Maven 2 workflows.
| Goal | Purpose | Typical use |
|---|---|---|
| clean:clean | Remove generated build files | Reset workspace before rebuild |
| eclipse:eclipse | Generate Eclipse project files | IDE setup |
| idea:idea | Generate IntelliJ IDEA project files | IDE setup |
| javadoc:javadoc | Generate API docs | Documentation builds |
| antrun:run | Run an Ant target from Maven | Bridge legacy Ant tasks |
| checkstyle:checkstyle | Run style checks | Code quality reporting |
| site:site | Generate project site and reports | Project documentation/reporting |
Migration guidance from Maven 1 to Maven 2
- Inventory all Maven 1 plugins used in CI/CD pipelines.
- Replace Maven 1-specific plugins with Maven 2-compatible equivalents.
- Move project build logic into
pom.xmland avoid script-heavy customization patterns. - Move user/private values (credentials, mirrors, local environment config) into
settings.xml. - If building multiple artifacts, define a parent project and child modules to use native multiproject execution.
Common pitfalls
- Assuming Maven 1 plugins will run in Maven 2 without change.
- Mixing project configuration and private environment settings in the wrong file.
- Following old repository endpoints without validating availability.
- Treating historical commands and goals as current defaults without checking present-day plugin status.
References and original sources
- Maven 1 to Maven 2 information
- Apache Maven home
- Maven model documentation (original link)
- Developer.com reference from original post
- Sonatype Maven book reference from original post
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals