Eclipse Setup

References

Configuration

  • Download and install [http://www.eclipse.org/downloads Eclipse IDE for Java EE Developers]. Ganymede (v3.4) is the current version.
  • Edit the eclipse.ini file:
    • add -vm <path to java jdk install of javaw.exe> (This is necessary for the m2eclipse plugin to work).
  • Windows->Preferences->Java->Installed JREs
    • Ensure that the java jdk you installed earlier is the one selected. If not, add it and make it the default
  • Import the following eclipse preferences (which are page attachments below):
ambra.java.formatting.xml Java code formatting directives for eclipse(contained in ambra.epf)
ambra.js.formatting.xml Javascript code formatting directives for eclipse (contained in ambra.epf)
ambra.importorder Java import order convention (contained in ambra.epf)
ambra.epf Aggregated eclipse workspace settings covering all ambra coding conventions
  • Install the following Add ons:
subversive http://download.eclipse.org/technology/subversive/0.7/update-site/ The preferred Subversion client for eclipse
subversive connectors http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/ Necessary plug-ins for svn client/server communication. Choose "Native JavaHL 1.5.0 [RC5]" and "Native JavaHL 1.4.5" only
m2eclipse http://m2eclipse.sonatype.org/update/ Eclipse Maven integration

Subversion 1.5 warning

Note that the Native JavaHL requires subversion 1.5 to be installed natively on your system. Otherwise you would get a cryptic error message.

An alternative is to use the pure java version provided by SVNKit. It works just fine. So you can use that instead of the Native JavaHL and subversion 1.5.

Trailing whitespace elimination

Trailing whitespace left over by 'auto-indentation' hints are quite painful for folks using vim. So please do everyone a favor by doing the following:

  • Windows->Preferences->Java->Editor->Save Actions
    • Choose 'Perform selected actions on save'
      • Ensure 'Remove trailing whitespace on all lines' is selected.

Project Importing

Please see http://www.sonatype.com/book/reference/eclipse.html for the way that works best. For folks working directly with subversion, I would recommend the "Checking Out a Maven Project from SCM" section.

But if you have your own work directory (eg. when using 'git' as the 'Team Synchronizer' in eclipse), then the following will work:

  • File->Import..->General->Maven Projects (m2eclipse version 0.9.1+)
    • Choose the root (head) dir of the desired ambra source tree (i.e. head or a branch)
    • Right click on project you want to open (ambra-webapp for instance)
    • Maven2->Enable

Java version in the-whole-shebang pom

Please see http://jira.codehaus.org/browse/MNGECLIPSE-966. The top level pom uses the maven.compiler.version property to set the version to 1.5. This is just fine when doing m2eclipse "Run as "->"mvn install" etc. However it won't work for incremental builds done by the 'Java Builder'. For that you need to set up the 'Windows->Preferences->Java ->Compiler->Compliance-Level' to 1.5.

m2eclipse overrides the workspace global settings to the ones in the pom.xml. That is the correct behavior. Unfortunately it gets it wrong. So this needs to be done for every project.

Attachments