{"id":232,"date":"2026-10-13T00:11:14","date_gmt":"2026-10-13T00:11:14","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2010\/04\/14\/difference-between-maven-1-and-maven-2\/"},"modified":"2026-10-13T00:11:14","modified_gmt":"2026-10-13T00:11:14","slug":"difference-between-maven-1-and-maven-2","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/difference-between-maven-1-and-maven-2\/","title":{"rendered":"Maven 1 vs Maven 2: Architecture, Lifecycle, and Migration Differences"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Originally published on 2010-04-14; fully revised and updated.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2010\/04\/maven-1-difference-maven-2.png\" alt=\"Maven 1 and Maven 2 differences\" \/><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Maven 1 vs Maven 2 at a glance<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">According to the original Maven documentation and migration notes, Maven 2 was a complete rewrite of Maven 1 and <strong>not backward-compatible<\/strong> with Maven 1 plugins. It also shifted teams toward a stronger POM-and-lifecycle model.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Aspect<\/th><th>Maven 1<\/th><th>Maven 2<\/th><th>Why it matters<\/th><\/tr><\/thead><tbody><tr><td>Core implementation<\/td><td>Original Maven codebase<\/td><td>Complete rewrite<\/td><td>Different internals and behavior<\/td><\/tr><tr><td>Plugin compatibility<\/td><td>Maven 1 plugins<\/td><td>Cannot execute Maven 1 plugins<\/td><td>Migration may require plugin replacement<\/td><\/tr><tr><td>Build customization<\/td><td>Commonly used scripting patterns (for example maven.xml)<\/td><td>Plugin-centric extension model<\/td><td>Less ad-hoc scripting, more structured plugins<\/td><\/tr><tr><td>Configuration style<\/td><td>Heavier properties-file usage<\/td><td>Project config in pom.xml; private\/user settings in settings.xml<\/td><td>Cleaner separation of project and environment concerns<\/td><\/tr><tr><td>Multi-project handling<\/td><td>Supported via plugin<\/td><td>Native parent\/child multi-project support<\/td><td>Better large-project orchestration<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Repository configuration differences<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The original post showed two different repository approaches: Maven 1 via properties, and Maven 2 via repository definitions with a legacy layout.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Maven 1 style (project.properties or build.properties)<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript language-properties\">maven.repo.remote=http:<span class=\"hljs-comment\">\/\/download.java.net\/maven\/1\/,http:\/\/www.ibiblio.org\/maven\/<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Maven 2 style (pom.xml repository with legacy layout)<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml language-xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">repositories<\/span>&gt;<\/span>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">repository<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">id<\/span>&gt;<\/span>java.net<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">id<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">url<\/span>&gt;<\/span>http:\/\/download.java.net\/maven\/1<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">url<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">layout<\/span>&gt;<\/span>legacy<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">layout<\/span>&gt;<\/span>\n  <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">repository<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">repositories<\/span>&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">The source also notes that Maven 2 introduced <code>settings.xml<\/code> for environment-specific and private configuration (such as credentials), while project behavior belongs in <code>pom.xml<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Maven 2 lifecycle workflow<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A key change in Maven 2 was the stronger lifecycle model. Running a later phase triggers earlier phases in sequence.<\/p>\n\n\n\n<pre class=\"mermaid\">\nflowchart TD\n    A[mvn clean install] --> B[Clean output directory]\n    B --> C[Compile source]\n    C --> D[Run unit tests]\n    D --> E[Package artifact]\n    E --> F[Install in local repository]\n    F --> G{Run mvn deploy?}\n    G -- yes --> H[Publish to remote repository]\n    G -- no --> I[Build complete]\n<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>compile<\/strong>: compile source code<\/li><li><strong>test<\/strong>: run unit tests<\/li><li><strong>package<\/strong>: create distributable artifact (for example JAR or WAR)<\/li><li><strong>integration-test<\/strong>: execute integration testing workflow<\/li><li><strong>install<\/strong>: install artifact in local repository<\/li><li><strong>deploy<\/strong>: publish artifact to remote repository<\/li><\/ul>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php language-bash\"><span class=\"hljs-comment\"># Common Maven 2 era usage<\/span>\nmvn clean install\nmvn deploy\n\n<span class=\"hljs-comment\"># Historical syntax seen in early Maven 2 docs<\/span>\nm2 clean:clean install<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Multi-project support and project layout<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The source emphasizes Maven 2\u2019s native multi-project execution with parent descriptors. Invoking a lifecycle from the parent can orchestrate child modules as part of one build.<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs language-text\">root\/\n  pom.xml\n  src\/\n    main\/\n      java\/\n        com\/daviddewolf\/maven\/example\/App.java\n    test\/\n      java\/\n        com\/daviddewolf\/maven\/example\/TestApp.java<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">The original article used the following project bootstrap command:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs language-bash\">m2 archetype:create -DgroupId=com.daviddewolf.maven -DartifactId=example<\/code><\/span><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Legacy Maven 2 goals frequently referenced<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">These goals were listed in the original post as commonly useful in Maven 2 workflows.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Goal<\/th><th>Purpose<\/th><th>Typical use<\/th><\/tr><\/thead><tbody><tr><td>clean:clean<\/td><td>Remove generated build files<\/td><td>Reset workspace before rebuild<\/td><\/tr><tr><td>eclipse:eclipse<\/td><td>Generate Eclipse project files<\/td><td>IDE setup<\/td><\/tr><tr><td>idea:idea<\/td><td>Generate IntelliJ IDEA project files<\/td><td>IDE setup<\/td><\/tr><tr><td>javadoc:javadoc<\/td><td>Generate API docs<\/td><td>Documentation builds<\/td><\/tr><tr><td>antrun:run<\/td><td>Run an Ant target from Maven<\/td><td>Bridge legacy Ant tasks<\/td><\/tr><tr><td>checkstyle:checkstyle<\/td><td>Run style checks<\/td><td>Code quality reporting<\/td><\/tr><tr><td>site:site<\/td><td>Generate project site and reports<\/td><td>Project documentation\/reporting<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Migration guidance from Maven 1 to Maven 2<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Inventory all Maven 1 plugins used in CI\/CD pipelines.<\/li><li>Replace Maven 1-specific plugins with Maven 2-compatible equivalents.<\/li><li>Move project build logic into <code>pom.xml<\/code> and avoid script-heavy customization patterns.<\/li><li>Move user\/private values (credentials, mirrors, local environment config) into <code>settings.xml<\/code>.<\/li><li>If building multiple artifacts, define a parent project and child modules to use native multiproject execution.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Common pitfalls<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Assuming Maven 1 plugins will run in Maven 2 without change.<\/li><li>Mixing project configuration and private environment settings in the wrong file.<\/li><li>Following old repository endpoints without validating availability.<\/li><li>Treating historical commands and goals as current defaults without checking present-day plugin status.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">References and original sources<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"http:\/\/maven.apache.org\/maven1.html\">Maven 1 to Maven 2 information<\/a><\/li><li><a href=\"http:\/\/maven.apache.org\/\">Apache Maven home<\/a><\/li><li><a href=\"http:\/\/maven.apache.org\/maven2\/maven-model\/maven.html\">Maven model documentation (original link)<\/a><\/li><li><a href=\"http:\/\/www.developer.com\/open\/print.php\/10930_3552026_2\">Developer.com reference from original post<\/a><\/li><li><a href=\"http:\/\/www.sonatype.com\/books\/maven-book\/reference\/installation-sect-upgrade-detail.html\">Sonatype Maven book reference from original post<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Maven 2 was a full rewrite of Maven 1, with a new lifecycle model, different configuration patterns, and no Maven 1 plugin compatibility. This guide compares both clearly and shows the commands and structure teams used when migrating.<\/p>\n","protected":false},"author":1,"featured_media":4260,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[10],"tags":[1584,1590,3838,1585,492,3841,296,161,3836,3844,3843,3845,3846,3839,3842,3837,3840,1591],"class_list":["post-232","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tools-comparison","tag-better","tag-choose","tag-comapre","tag-comparison","tag-difference","tag-difference-between-maven-1-and-maven-2","tag-features","tag-maven","tag-maven-1","tag-maven-1-and-maven-2-analysis","tag-maven-1-and-maven-2-comparison","tag-maven-1-and-maven-2-differences","tag-maven-1-and-maven-2-review","tag-maven-1-review","tag-maven-1-vs-maven-2","tag-maven-2","tag-maven-2-review","tag-select"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=232"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/232\/revisions"}],"predecessor-version":[{"id":79062,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/232\/revisions\/79062"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/4260"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}