[Engine-devel] Eclipse IDE setup

Yair Zaslavsky yzaslavs at redhat.com
Wed Feb 8 06:43:31 UTC 2012


On 02/08/2012 01:02 AM, Itamar Heim wrote:
> On 02/07/2012 04:26 PM, Shireesh Anjal wrote:
>> Hi,
>>
>> I went through setting Eclipse IDE for engine development recently.
>>
>> After getting the maven build to work, and after importing all
>> projects into eclipse, following setup is required to get rid of all
>> compilation errors reported by eclipse:
>>
>> 1) at restapi-definition ->  project ->  properties ->  java build
>> path ->  source ->  add source folder ->  target/generated sources/xjc
>> 2) at webadmin ->  project ->  properties ->  java build path -> 
>> source ->  add source folder->  target/generated
>> sources/annotations,gwt,test-annotations
>>
>> 3) To get rid of the error "The method setCharacterEncoding(String) is
>> undefined for the type  HttpServletResponse" in source
>> frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/WebadminDynamicHostingServlet.java,
>> I modified pom.xml at root level to change servlet API version from
>> 2.3 to 2.4 as the concerned API is introduced in 2.4
>>
>> <javax.ejb.api.version>3.0</javax.ejb.api.version>
>> -<javax.servlet.api.version>2.3</javax.servlet.api.version>
>> +<javax.servlet.api.version>2.4</javax.servlet.api.version>
>> <jcraft.jsch.version>0.1.42</jcraft.jsch.version>
>>
>> 4) Make sure that you import the engine code formatter into eclipse
>> _before_ starting development.
>>
>> Window ->  Preferences ->  Java ->  Code Style ->  Formatter -> 
>> Import ->  <ovirt-src-root>/config/engine-code-format.xml
>>
>> 5) Above mentioned formatted doesn't work in comments. This can be
>> resolved by adding "Remove trailing whitespace" in "Save actions" as
>> follows:
>>
>> Window ->  Preferences ->  Java ->  Editor ->  Save Actions -> 
>> Additional Actions ->  Configure ->  Code Organizing ->  Remove
>> trailing whitespace ->    All lines
I would like to add that our maven checkstyle plugin also fails build on
unused import. Make sure you also got it covered.
I personally did not set this at my IDE, but I rather handle this issue
manually.

>>
>> 6) For some reason, editing a properties file in eclipse results in a
>> lot of "diff" in git, making it difficult to review the code change.
>> So I'm resorting to editing properties file in a text editor outside
>> eclipse for the time being. I suspect this may not happen on all
>> machines.
> 
> Shireesh - great points - care to update the wiki?
> Also - I'd like to hope we can clean the pom files so #1-#3 would not be
> needed manually?
> _______________________________________________
> Engine-devel mailing list
> Engine-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel




More information about the Engine-devel mailing list