Configure Eclipse

Configure Eclipse to view Sonar reports

  1. Install sonar plug-in:
  2. Configure the connection to sonar:
  3. Then, for each project you need to activate the sonar plug-in:
    • Right-click on project -> configure -> Associate with sonar...
  4. (Optional) Add a Sonar view    
    • Window -> Show view -> sonar -> violations

Java code formatting in Eclipse

Download the formatting file available here and add it to your Eclipse configuration. Go to Window --> Preferences. Then select Java --> Code Style --> Formatter and click on the Import... button.

java code formatter

To format all the sources of a given project, right-click on the src/main/java directory and select Sources --> Format

Auto-completion of XHTML tags

If you want Eclipse to auto-complete the tags of your XHTML files and to give you the list of available attributes for a tag, read this tutorial. In addition, to have the rich and a4j tags listed, you can create a user library and add richfaces-api, richfaces-impl et richfaces-ui. You will find those binaries in your .m2 repository in /org/richfaces/framework and /org/richfaces/ui folders.

Template for loggers

We recommand to use sl4j for logging information in JBoss logs. Download the file available here and add it as a template in Eclipse (see the screenshot below). Then, each time you want to insert a logger in your Java class, type "logg" and ctrl-space for completion. A static field will be created and the logs will be redirected to log4j in JBoss.

Logger template