Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

Maven 1 vs Maven 2: Architecture, Lifecycle, and Migration Differences

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 and Maven 2 differences

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.

AspectMaven 1Maven 2Why it matters
Core implementationOriginal Maven codebaseComplete rewriteDifferent internals and behavior
Plugin compatibilityMaven 1 pluginsCannot execute Maven 1 pluginsMigration may require plugin replacement
Build customizationCommonly used scripting patterns (for example maven.xml)Plugin-centric extension modelLess ad-hoc scripting, more structured plugins
Configuration styleHeavier properties-file usageProject config in pom.xml; private/user settings in settings.xmlCleaner separation of project and environment concerns
Multi-project handlingSupported via pluginNative parent/child multi-project supportBetter 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.

GoalPurposeTypical use
clean:cleanRemove generated build filesReset workspace before rebuild
eclipse:eclipseGenerate Eclipse project filesIDE setup
idea:ideaGenerate IntelliJ IDEA project filesIDE setup
javadoc:javadocGenerate API docsDocumentation builds
antrun:runRun an Ant target from MavenBridge legacy Ant tasks
checkstyle:checkstyleRun style checksCode quality reporting
site:siteGenerate project site and reportsProject 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.xml and 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

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
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.

Related Posts

Maven vs Ant: Key Differences, Build Workflow, and When to Use Each

Maven and Ant both automate Java builds, but they use very different models. This guide compares their workflows, configuration style, and CI implications with practical examples.

Read More

UCC vs CLOC vs POWERSOFTWARE vs EZ-Metrics vs Metrixware: Cleaned 2013 Comparison and Evaluation Workflow

This revised article cleans up a legacy 2013 comparison of five code metrics tools and preserves the original claims in a readable format. It also adds a practical workflow and reproducible command examples you can use to evaluate tools on your own codebase.

Read More

SLOC Tools Comparison: Original 2013 List, Selection Criteria, and CI Examples

This revised guide preserves the original SLOC tools list and adds practical DevOps guidance for evaluating and operationalizing code line counting. You will get a clean comparison table, a CI workflow diagram, and ready-to-adapt command examples.

Read More

AnthillPro vs Atlassian Bamboo (2010): CI Server or Full Release Lifecycle Platform?

This revised guide reframes a 2010 AnthillPro vs Bamboo comparison into a clear, structured reference. It preserves the original claims, adds context, and gives you a practical framework for evaluating CI/CD tools today.

Read More

Bamboo vs TeamCity vs CruiseControl: Historical CI Comparison and Practical Evaluation Guide

This revised guide turns a brief 2010 comparison into a structured, engineering-focused reference. It preserves the original claims, adds a CI workflow diagram, and provides a practical checklist for modern tool evaluation.

Read More

File Comparison Tools for DevOps: Revised Review of Beyond Compare, WinMerge, Diffutils, and More

File comparison is core to safe change management in DevOps, from reviewing config drift to resolving merge conflicts. This revised review summarizes the original tool list with a practical workflow, side-by-side comparisons, and command examples.

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x