Install Eclipse & Plugins
Eclipse Indigo (3.7)
As of 4th April 2012 our SVN repository will be gradually migrated to GIT. The new Eclipse bundle is based on latest (as of April 2012) Indigo and also contains EGit plugin, an Eclipse Team provider for the Git version control system. For any question concerning Eclipse and Git integration, please read the EGit User guide.
To know more about Git usage you can start by reading our wiki page
If you can access Magnolia's internal network, a preinstalled eclipse for Mac OS X(Cocoa 64) called eclipse-indigo-macosx-cocoa-64-egit.zip can be found at our file server under Product Development/Eclipse
There is also preinstalled eclipse for Linux-64b. It can also be found in Product Development/Eclipse folder. This version supports Git DVCS.
The eclipse-indigo-macosx-cocoa-64-egit.zip bundle was created on 10 April 2012 and consists of the following platform, plugins and related versions:
By default cloning a Git repo and then importing it as a Java or Maven project does not show it as "shared", meaning that the Eclipse project looks disconnected from your local Git repo. If you're used to work with SVN you might find this baffling, as you're accostumed to checkout a project from the central scm repository and see it connected to it, so that changes to your local copy are visually decorated by a special label or icon. In order to save you some clicks to achieve the same with Git you need to check the following option under
Eclipse -> Preferences -> Team -> Git -> Projects
m2e 1.0 known issue
Indigo introduces m2e (Maven 2 Eclipse) 1.0, which seems to cause some problems with plugins that are not "known" by m2e. This hits Magnolia with the setproperty Maven plugin and other Maven plugins as well (See list below). If you have m2e 1.0 installed you will likely get the following error upon importing a Maven project (i.e. a Magnolia module) into Eclipse:
No marketplace entries found to handle Execution currentDate, in /pom.xml in Eclipse. Please see Help for more information.
Just choose to resolve the issue later and import the project.
Table of plugins which currently do not have a m2e connector
(Last update April 2012)
Other handy plugins
The following plugins might come in handy. These are not part of the Indigo bundle for now.
See Maven setup. Be sure to follow these steps first as else you'll not be able to checkout magnolia properly!
Add SVN Repository
You will have to register our SVN repository in case you want to checkout magnolia modules/projects
- open SVN Repository Exploring Perspective
- add repository location
Create/Checkout a Project
- open "SVN Repository" perspective (Window -> Open perspective)
- select module/project to check out
- click "Check out as Maven project..." in the context menu
Importing an already checked out project from file system
Sometimes it is more convenient to checkout a project manually and then use the eclipse import function. This is especially helpful if the module to be imported has submodules.
- File -> Import
- in the import dialog select 'Maven Projects'
Setup the Server (Tomcat)
Create a Server
If not yet done create a server.
Deploy the Webapp project
Open Server Edit Pane
Doubleclick on the server item
Server settings: Disable publishing
Make sure that the option Serve modules without publishing is selected. This ensures that the classes are taken from the target directories.
Server settings: Increase timeouts
In these same settings, increase both timeout values by a factor of 10.
Freemarker specific settings
Taglib definitions (tld)
FreeMarker does not search the classpath to find taglib definition. It uses only
WEB-INF/lib and the entries defined in
web.xml directly. There are two workarounds:
A) Register taglib definitions in
web.xmland add the taglib definitions as follows. It is important to add them before
- Copy the files to
B) Put minimal JARs into
- In the
webappfolder, execute: This generates a complete webapp in your
src/webappdirectory as opposed to
target/webapp-name-1.0-SNAPSHOT. This is an Eclipse specific workaround.
- Delete all JARs except the taglib JARs in
- Minimize the taglib JAR
Freemarker templates do not provide automatically auto completion of the provided objects.
The provided objects like ctx, stk or mgnl must be declared to the IDE, that they can be auto completed.
There for a configuration file must be provided in each project in your workspace. The file is named '.freemarker-ide.xml'. I have attached it to this page without the dot at the beginning, or I can't upload it on the Mac otherwise (hidden).
The important part of this configuration file is the declaration of the objects the auto completion should know. I think these four declarations I use make sense:
Configure Code Style
If you are an internal developer or a contributor please follow the instructions found here: Coding Conventions.
Tips and Tricks
Get the sources or a linked jar / module
- select the jar (in the Maven Dependencies library)
- right click -> Maven -> Download Sources
The dependencies are resolved inside the workspace. This is quite helpful. But this will only work if the version you reference in the project and the version of the module you checked out has the same version. In some cases you will have to adapt the pom files locally (to point to the current snapshot for instance).
Use company wide Java Code Style & Compiler preferences
Simply import the preferences file into your Eclipse.
Wrong maven version is used for dependency checks
If the project can't build because of the following message (printed in Maven Console)
The expected stacktrace on startup is:
You can either add the following to the pluginManagement section in your main project pom to disable the enforcer plugin or select the eclipse profile:
Then clean all projects
To ensure that everything is fine you have to check that magnolia-core/target/classes/mgnl-bean.properties exists.
Freemarker can't find tags (tlds)
Project contains duplicate entry
Sometimes the same jar is references twice (by maven and EAR dependencies). This sometimes happens if you open eclipse freshly. To make the project compile again you must remove the ear dependency:
- right click project -> Java EE -> Update EAR libraries
Class Cast Exception: info.magnolia.cms.filters.MgnlMainFilter
This typically depends on the servlet-api AND/OR the gwt-user dependencies in your pom.xml(s) and Tomcat (i.e. never seen this problem with jetty). The solutions provided below are not mutually exclusive and you might need to apply a combination or all of them.
Solution 1: exclude the servlet api jar. Verify that you don't have the servlet api jar in your maven dependencies.
Solution 2: make the servlet-api dependency scope
Solution 3: make the gwt-user dependency scope
Webapp project doesn't work
- make sure that you have only one webapp project open
- add the pom dependency (not only the war dependency) otherwise the dependencies defined in the referenced war file won't be seen
- use mvn war:inplace to overlay the webapp project (make sure that the WEB-INF/web.xml exists
- ensure that you delete WEB-INF/lib after a war:inplace
- check settings
project/project facets/dynamic web module==> 2.4 works (helios, wtp 2.4), 3.0 doesn't (helios, wtp 3.0)
NPE when configuring tomcat with "don't publish" option
- delete Servers, delete .project and .settings from the webapp and reimport the webapp
webapp is not recognized as webapp and doesn't show in tomcat when trying to add it
- go to
project/project facetsand make sure
dynamic web moduleand
- rebuild the project
modules are not installed when installing the webapp
- cause: modules are not visible if the faceted build version of java doesn't match the current version or that used by the webapp project
- solution: update project config and change java version
Module Dependency Exception
Solution: ensure that no resource is excluded under myCoolModule -> Build path -> Configure Build Path... This might happen when i.e. updating the Maven dependencies if the m2Eclipse plugin is installed.
Trouble shooting step by step
- check if there are any build issues denoted in the problem view
- check if there are any problems denoted in the pom.xml (missing parents, ..)
- check if the project builds in the terminal (by using mvn only)
- are the parent poms available?
- check the maven log in eclipse (select the maven console in the console view)
- are the logs fine?
- verify that there is no version conflict thrown by the enforcer plugin
- if so configure the project to use the eclipse profile in the project settings (maven tab)
- clean the project
- this ensures that maven is used to build the resources
- verify that the resources have been built (module descriptor in
- update project configuration
- right click project -> maven -> update project configuration
- check the maven console (some errors are not reported to the GUI)
- one last step can be added to the above Eclipse voodoo dance: ensure that no resource is excluded under
Install Sun JDK to Ubuntu
By default Ubuntu packagers are not supporting sun jdk. You have to add new software source: