{"id":238,"date":"2011-01-25T10:14:55","date_gmt":"2011-01-25T18:14:55","guid":{"rendered":"http:\/\/hongyu.org\/wordpress\/?p=238"},"modified":"2011-01-25T23:13:58","modified_gmt":"2011-01-26T07:13:58","slug":"build-multiple-module-maven-project-in-eclipse","status":"publish","type":"post","link":"https:\/\/www.hongyu.org\/wordpress\/?p=238","title":{"rendered":"Build multiple-module maven project in Eclipse"},"content":{"rendered":"<p>Reference:<br \/>\nhttp:\/\/www.sonatype.com\/books\/m2eclipse-book\/reference\/<br \/>\nhttp:\/\/maven.apache.org\/plugins\/maven-eclipse-plugin\/reactor.html<br \/>\nhttp:\/\/yyhh.org\/blog\/2008\/02\/create-multiple-modules-maven-project-eclipse<\/p>\n<p>My summary:<\/p>\n<ul>\n<li><strong>Create the maven project<\/strong> by run the following maven command in *nix shell or windows cmd under the Eclipse workspace:<br \/>\nmvn archetype:create -DgroupId=testgroup -DartifactId=test\n <\/li>\n<li><strong>Modify the project<\/strong>. Delete the src\/ subfolder and then edit the pom.xml to make sure the packaging element in it is set to &#8220;pom&#8221; instead of the original &#8220;jar&#8221;.\n        <\/li>\n<li><strong>Create module<\/strong>. First enter the project folder (cd test); and then run the maven command:<br \/>\nmvn archetype:create -DgroupId=testgroup.module1 -DartifactId=module1\n<\/li>\n<li><strong>Create a new project in Eclipse<\/strong>. Two methods can be used depending on the version of m2eclipse:\n<ul>\n<li>For new version of m2eclipse. Click the Eclipse menu: File -> Import -> Maven -> Existing Maven Projects<\/li>\n<li>For old version of m2eclipse. Run the command:<br \/>\nmvn eclipse:eclipse<br \/>\nand then click the Eclipse menu: File -> New -> Project -> General -> Project, and then click Next, and put the Project name as &#8220;test&#8221;. Click Finish.\n        <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Reference: http:\/\/www.sonatype.com\/books\/m2eclipse-book\/reference\/ http:\/\/maven.apache.org\/plugins\/maven-eclipse-plugin\/reactor.html http:\/\/yyhh.org\/blog\/2008\/02\/create-multiple-modules-maven-project-eclipse My summary: Create the maven project by run the following maven command in *nix shell or windows cmd under the Eclipse workspace: mvn archetype:create -DgroupId=testgroup -DartifactId=test Modify the project. Delete the src\/ subfolder and then edit the pom.xml to make sure the packaging element in it is set to &#8220;pom&#8221; instead &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.hongyu.org\/wordpress\/?p=238\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Build multiple-module maven project in Eclipse&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/238"}],"collection":[{"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=238"}],"version-history":[{"count":13,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/238\/revisions"}],"predecessor-version":[{"id":254,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/238\/revisions\/254"}],"wp:attachment":[{"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}