View Source

{section}
{column}

h1. Eclipse configuration for Petals source code

h2. Use the right source code formatter for Java files

You can define it by following these steps :
* go to *Window \-> Preferences*, then select *Java \-> Code Style \-> Formatter*:
!formatter.png!

* click on "*Import*", and select the file "eclipse_formatter.xml" from the svn repository : [https://svn.petalslink.org/svnroot/trunk/product/dev/prod/petals/dev-tools/petals-checkstyle-rules/src/main/resources/eclipse/eclipse_formatter.xml|https://svn.petalslink.org/svnroot/trunk/product/dev/prod/petals/dev-tools/petals-checkstyle-rules/src/main/resources/eclipse/eclipse_formatter.xml]
* click on "*Apply*" to save.

{column}
{column:width=35%}
{panel:title=Table of contents}{toc:outline=true}{panel}
{panel:title=Contributors}{contributors:order=name|mode=list|showAnonymous=true|showCount=true|showLastTime=true}{panel}
{column}
{section}

h2. Use the right source code formatter for XML files

Configure your XML formatter as following:
* go to *Window \-> Preferences*, then select *XML \-> XML Files \-> Editor*,
* apply the following configuration:
!formatter-xml.png!

h2. Use the right source code formatter for Apache Ant files

Configure your XML formatter as following:
* go to *Window \-> Preferences*, then select *Ant \-> Editor \-> Formatter*,
* apply the following configuration:
!ant.png!

* click on "*Apply*" to save.

h2. Set the right save actions

Configure your *Save actions* as following:
* go to *Window \-> Preferences*, then select *Java \-> Editor \-> Save Actions*,
* apply the following configuration:
!SaveActions.png!

* click on "*Apply*" to save.

h2. Set the right configuration to run JUnit tests

Configure your *JUnit preferences* as following:
* go to *Window \-> Preferences*, then select *Java \-> JUnit*,
* check the box *Add '-ea' to VM arguments when creating a new JUnit launch configuration*:
!junit.png!

* click on "*Apply*" to save.

h2. Integrating the Petals SonarQube Server

Configure the Petals SonarQube Server as following:
* go to *Window \-> Preferences*, then select *SonarQube \-> Servers*,
* apply the following configuration:
!sonar.png!

To see Sonar violations into your Java editor, you must re-import your projects.