{"id":6115,"date":"2012-09-29T14:45:07","date_gmt":"2012-09-29T19:45:07","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=6115"},"modified":"2012-10-13T20:14:58","modified_gmt":"2012-10-14T01:14:58","slug":"maven-eclipse-plugin","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=6115","title":{"rendered":"Maven Multiple Module Projects"},"content":{"rendered":"<div class='toc wptoc'>\n<h2>Contents<\/h2>\n<ol class='toc-odd level-1'>\n\t<li>\n\t\t<a href=\"#Multiple_Module_Projects\">Multiple Module Projects<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Setup_Multiple_Module_Projects\">Setup Multiple Module Projects<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Check_Into_SVN\">Check Into SVN<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Setup_Eclipse_SVN_Repository_Location\">Setup Eclipse SVN Repository Location<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Checkout_All_Projects\">Checkout All Projects<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Checkout_Individual_Project\">Checkout Individual Project<\/a>\n\t\t\t<\/li>\n\t\t<\/ol>\n\t<li>\n\t\t<a href=\"#References\">References<\/a>\n\t<\/li>\n<\/ol>\n<\/ol>\n<\/div>\n<div class='wptoc-end'>&nbsp;<\/div>\n<span id=\"Multiple_Module_Projects\"><h2>Multiple Module Projects<\/h2><\/span>\n<p>* See <a href=\"http:\/\/maven.apache.org\/plugins\/maven-eclipse-plugin\/reactor.html\">Multiple Module Projects<\/a> for detailed instructions.<\/p>\n<span id=\"Setup_Multiple_Module_Projects\"><h3>Setup Multiple Module Projects<\/h3><\/span>\n<p>* Create a new directory named <em>step-by-step<\/em><br \/>\n* cd to the new directory<br \/>\n* Create a new Maven simple project:<\/p>\n<pre lang=\"bash\">\r\nmvn archetype:create -DgroupId=guide.ide.eclipse -DartifactId=guide-ide-eclipse\r\n<\/pre>\n<p>* cd to <em>guide-ide-eclipse<\/em> directory<br \/>\n* Modify <em>pom.xml<\/em> and change packaging value from <em>jar<\/em> to <em>pom<\/em><\/p>\n<pre lang=\"bash\">\r\n  <packaging>pom<\/packaging>\r\n<\/pre>\n<p>* Issue Maven commands to build three additional child projects<\/p>\n<pre lang=\"bash\">\r\nmvn archetype:create -DgroupId=guide.ide.eclipse -DartifactId=guide-ide-eclipse-site\r\nmvn archetype:create -DgroupId=guide.ide.eclipse.core -DartifactId=guide-ide-eclipse-core\r\nmvn archetype:create -DgroupId=guide.ide.eclipse.module1 -DartifactId=guide-ide-eclipse-module1\r\n<\/pre>\n<p>* Steps 7 and 8 automatically done for you already with Maven 3.0.4<br \/>\n* cd to <em>guide-ide-eclipse-module1<\/em><br \/>\n* Edit <em>pom.xml<\/em> to add dependency for <em>guide-ide-eclipse-core<\/em><\/p>\n<pre lang=\"xml\">\r\n    <dependency>\r\n      <groupId>guide.ide.eclipse.core<\/groupId>\r\n      <artifactId>guide-ide-eclipse-core<\/artifactId>\r\n      <version>1.0-SNAPSHOT<\/version>\r\n    <\/dependency>\r\n<\/pre>\n<span id=\"Check_Into_SVN\"><h3>Check Into SVN<\/h3><\/span>\n<p>* <strong>Important!<\/strong> Check or import all projects into SVN before continue. For example, import <em>step-by-step<\/em> directory to SVN trunk<br \/>\n* Remove <em>guide-ide-eclipse<\/em> directory form workspace after it&#8217;s been imported into SVN<\/p>\n<span id=\"Setup_Eclipse_SVN_Repository_Location\"><h3>Setup Eclipse SVN Repository Location<\/h3><\/span>\n<p>* Start Eclipse<br \/>\n* Select workspace directory, e.g. <em>C:\\work\\sandbox\\maven\\eclipseplugin\\workspace\\step-by-step<\/em><br \/>\n* Install Subclipse if not already done<\/p>\n<span id=\"\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Subclipse_Marketplace_Install.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Subclipse_Marketplace_Install-300x165.png\" alt=\"\" title=\"Subclipse_Marketplace_Install\" width=\"300\" height=\"165\" class=\"aligncenter size-medium wp-image-6132\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Subclipse_Marketplace_Install-300x165.png 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Subclipse_Marketplace_Install.png 560w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<p>* Select <em>Window > Show View > Other > SVN Repositories<\/em><br \/>\n* If not already done, add SVN repository where the project was checked in, e.g. <em>file:\/\/\/C:\/work\/sandbox\/maven\/eclipseplugin\/svn<\/em><\/p>\n<span id=\"_1\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Subclipse_Repository_guide-ide-eclipse.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Subclipse_Repository_guide-ide-eclipse-300x201.png\" alt=\"\" title=\"Subclipse_Repository_guide-ide-eclipse\" width=\"300\" height=\"201\" class=\"aligncenter size-medium wp-image-6133\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Subclipse_Repository_guide-ide-eclipse-300x201.png 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Subclipse_Repository_guide-ide-eclipse.png 356w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<span id=\"Checkout_All_Projects\"><h3>Checkout All Projects<\/h3><\/span>\n<p>* See <a href=\"?p=5957#Manually_Checkout_Multiple_Module_Maven_Projects_from_Subversion\">this post<\/a> on how to manually checkout multi module Maven projects from SVN.<br \/>\n* You&#8217;ll need to add a classpath variable named <strong>M2_REPO<\/strong> to point to your local Maven repository.<\/p>\n<span id=\"_2\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Maven_Eclipse_M2_REPO_classpath_var.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Maven_Eclipse_M2_REPO_classpath_var-300x263.png\" alt=\"\" title=\"Maven_Eclipse_M2_REPO_classpath_var\" width=\"300\" height=\"263\" class=\"aligncenter size-medium wp-image-6135\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Maven_Eclipse_M2_REPO_classpath_var-300x263.png 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Maven_Eclipse_M2_REPO_classpath_var.png 628w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<span id=\"Checkout_Individual_Project\"><h3>Checkout Individual Project<\/h3><\/span>\n<p>* Setup SVN repository as shown in previous section<br \/>\n* From SVN Repositories view, right click <em>guide-ide-eclipse-module1<\/em> and select <em>checkout<\/em><br \/>\n* Select <em>Checkout as a project in the workspace<\/em><\/p>\n<span id=\"_3\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Subclipse_Repository_Checkout_guide-ide-eclipse-module1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Subclipse_Repository_Checkout_guide-ide-eclipse-module1-300x280.png\" alt=\"\" title=\"Subclipse_Repository_Checkout_guide-ide-eclipse-module1\" width=\"300\" height=\"280\" class=\"aligncenter size-medium wp-image-6134\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Subclipse_Repository_Checkout_guide-ide-eclipse-module1-300x280.png 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Subclipse_Repository_Checkout_guide-ide-eclipse-module1.png 517w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<p>* Go to the checkout directory, e.g. <em>C:\\work\\sandbox\\maven\\eclipseplugin\\workspace\\step-by-step_2\\guide-ide-eclipse-module1<\/em><br \/>\n* Issue following Maven commands:<\/p>\n<pre lang=\"bash\">\r\nmvn eclipse:eclipse\r\n\r\n# If you want to download sources as well\r\nmvn eclipse:eclipse -DdownloadSources=true\r\n<\/pre>\n<p>* From Eclipse, refresh <em>guide-ide-eclipse-module1<\/em> project<br \/>\n* You&#8217;ll need to add a classpath variable named <strong>M2_REPO<\/strong> to point to your local Maven repository, e.g. <em>C:\\Users\\Jimmy\\.m2\\repository<\/em><\/p>\n<span id=\"_4\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Maven_Eclipse_M2_REPO_classpath_var.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Maven_Eclipse_M2_REPO_classpath_var-300x263.png\" alt=\"\" title=\"Maven_Eclipse_M2_REPO_classpath_var\" width=\"300\" height=\"263\" class=\"aligncenter size-medium wp-image-6135\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Maven_Eclipse_M2_REPO_classpath_var-300x263.png 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Maven_Eclipse_M2_REPO_classpath_var.png 628w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<p>* Final checked out Java project:<\/p>\n<span id=\"_5\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Eclipse_Proj_guide-ide-eclipse-module1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Eclipse_Proj_guide-ide-eclipse-module1-300x115.png\" alt=\"\" title=\"Eclipse_Proj_guide-ide-eclipse-module1\" width=\"300\" height=\"115\" class=\"aligncenter size-medium wp-image-6136\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Eclipse_Proj_guide-ide-eclipse-module1-300x115.png 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/09\/Eclipse_Proj_guide-ide-eclipse-module1.png 505w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<span id=\"References\"><h2>References<\/h2><\/span>\n<p>* <a href=\"http:\/\/maven.apache.org\/plugins\/maven-eclipse-plugin\/\">Maven Eclipse Plugin<\/a><br \/>\n* <a href=\"http:\/\/maven.apache.org\/plugins\/maven-eclipse-plugin\/usage.html\">Maven Eclipse Plugin: Usage<\/a><br \/>\n* <a href=\"http:\/\/maven.apache.org\/plugins\/maven-eclipse-plugin\/reactor.html\">Multiple Module Projects<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Multiple Module Projects * See Multiple Module Projects for detailed instructions. Setup Multiple Module Projects * Create a new directory named step-by-step * cd to the new directory * Create a new Maven simple project: mvn archetype:create -DgroupId=guide.ide.eclipse -DartifactId=guide-ide-eclipse * &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=6115\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[128],"tags":[605],"class_list":["post-6115","post","type-post","status-publish","format-standard","hentry","category-maven","tag-maven"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-1AD","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/6115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6115"}],"version-history":[{"count":12,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/6115\/revisions"}],"predecessor-version":[{"id":6276,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/6115\/revisions\/6276"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}