Contents
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
* cd to guide-ide-eclipse directory
* Modify pom.xml and change packaging value from jar to pom
<packaging>pom</packaging>
* Issue Maven commands to build three additional child projects
mvn archetype:create -DgroupId=guide.ide.eclipse -DartifactId=guide-ide-eclipse-site mvn archetype:create -DgroupId=guide.ide.eclipse.core -DartifactId=guide-ide-eclipse-core mvn archetype:create -DgroupId=guide.ide.eclipse.module1 -DartifactId=guide-ide-eclipse-module1
* Steps 7 and 8 automatically done for you already with Maven 3.0.4
* cd to guide-ide-eclipse-module1
* Edit pom.xml to add dependency for guide-ide-eclipse-core
<dependency> <groupId>guide.ide.eclipse.core</groupId> <artifactId>guide-ide-eclipse-core</artifactId> <version>1.0-SNAPSHOT</version> </dependency>
Check Into SVN
* Important! Check or import all projects into SVN before continue. For example, import step-by-step directory to SVN trunk
* Remove guide-ide-eclipse directory form workspace after it’s been imported into SVN
Setup Eclipse SVN Repository Location
* Start Eclipse
* Select workspace directory, e.g. C:\work\sandbox\maven\eclipseplugin\workspace\step-by-step
* Install Subclipse if not already done
* Select Window > Show View > Other > SVN Repositories
* If not already done, add SVN repository where the project was checked in, e.g. file:///C:/work/sandbox/maven/eclipseplugin/svn
Checkout All Projects
* See this post on how to manually checkout multi module Maven projects from SVN.
* You’ll need to add a classpath variable named M2_REPO to point to your local Maven repository.
Checkout Individual Project
* Setup SVN repository as shown in previous section
* From SVN Repositories view, right click guide-ide-eclipse-module1 and select checkout
* Select Checkout as a project in the workspace
* Go to the checkout directory, e.g. C:\work\sandbox\maven\eclipseplugin\workspace\step-by-step_2\guide-ide-eclipse-module1
* Issue following Maven commands:
mvn eclipse:eclipse # If you want to download sources as well mvn eclipse:eclipse -DdownloadSources=true
* From Eclipse, refresh guide-ide-eclipse-module1 project
* You’ll need to add a classpath variable named M2_REPO to point to your local Maven repository, e.g. C:\Users\Jimmy\.m2\repository
* Final checked out Java project:
References
* Maven Eclipse Plugin
* Maven Eclipse Plugin: Usage
* Multiple Module Projects