The following instructions will enable you to get Geronimo into the Eclipse workspace as an eclipse project. For purposes of this discussion the development OS is Windows. Please adjust these instructions for your environment.
Prerequisites
Before getting started, you have to intall the following software:
- Install Eclipse following the guide in Installing Eclipse.
- Install Maven 2.0.10 or above.
- Install Subversion.
- Install the Maven Plugin for Eclipse.
Creating Eclipse Projects
You could import all the geronimo projects or subprojects in the workspace. But a more efficient way is to import only the modules that you want to work on.
Working with a single module
If you are planning to modify a single geronimo module, you can import only that module in the workspace by running the following commands:
cd modules\a_module or cd maven-plugins\a_plugin mvn -o eclipse:eclipse
Working with multiple modules
It is advised that the first time users import all the modules.
Generate the Eclipse projects for geronimo sub-projects by invoking the following command from the top directory:
mvn -o eclipse:eclipse
Note:
The very first time you must omit the "-o" parameter so that it will download the maven-eclipse-plugin.
mvn eclipse:eclipse
It is possible to import only a few modules in the workspace by running the above command from each of the modules directory. In this case the changes made in one module will not be visible to other modules without rebuilding the modified module with mvn.
Useful Information
It is possible edit .classpath files so that the changes made in one module are visible to all other modules in the workspace instantly. This is meant only for advanced users.
Firing up Eclipse
- Import the project(s) to eclipse workspace using:
Select project or projects depending on how you created the project in the #Creating Eclipse Projects step.
File --> Import --> +General --> Existing Projects into Workspace
- Set the Maven Classpath variable M2_REPO to tell Eclipse where the Maven repository is by clicking the "New" button in
Enter M2_REPO and set it to your maven2 repository directory. On linux this directory is usually located at
Window --> Preferences --> Java --> Build Path --> Classpath Variables
and on windows its usually at~/.m2/repository
."%USERPROFILE%\.m2\repository"
- If you are working on a builder module, i.e. geronimo-tomcat6-builder, you must add xmlbeans classes to the build path.
Right click on the builder project and Select "Add Class Folder" by doing the following:Check target/clover/classes folder from the selection.<Project> --> Build Path --> Configure Build Path --> Java Build PAth --> Add Class Folder
- To prevent Eclipse from copying the .svn directories to the output folder of projects, do the following:
Expand 'Output folder' setting usingAppend ,*.svn to the ''Filtered Resources'' field.Window --> Preferences --> Java --> Compiler --> Building --> Output folder
Code Formatting
- If you plan on contributing code or patches to the project, configure eclipse to not use tabs by doing the following:
Click on "Edit". Under Indentation select Tab policy as "space only". Enter a new name for this profile and click "OK".
Window --> Preferences --> Java --> Code Style --> Formatter --> Java Conventions [built-in]
Eclipse IDE configuration files
You may want to import the following files and have the environment configured in a couple of clicks.
Window --> Preferences --> Java --> Code Style --> Formatter --> Import
Geronimo-template-formatter.xml
Window --> Preferences --> Java --> Code Style --> Code Templates --> Import