Building logback under Eclipse in 61 easy steps.

Hi All, Here are step by step instruction for building logback under Eclipse in 61 easy steps. For me, the key to building logback under Eclipse is to avoid using m2eclipse. If you have it installed, you can disable it by removing the Maven Nature for a given project. - Install Eclipse Indigo, aka Eclipse 3.7 - in eclipse.ini file modify the parameter "mx", i.e. change -Xmx384m to -Xmx1384m - Install Groovy-Eclipse Feature from http://dist.springsource.org/release/GRECLIPSE/e3.7/ no installation of m2e Configurator for Groovy-Eclipse necessary - Install Scala IDE for Eclipse from http://download.scala-ide.org/releases-29/2.0.0-beta no installation of JDT Weaving, no Scala IDE for Eclipse Source feature necessary. - cd $LOGBACK_HOME where $LOGBACK_HOME stands for the location where you cloned the logback project from github - Remove any existing .settings, .classpath, .project directories under $LOGBACK_HOME and its sub-folders. This step seems to be crucial. - Run 'mvn eclipse:eclipse' in $LOGBACK_HOME - In eclipse import the logback project: Import -> General -> Existing Prokects into Workspace, select $LOGBACK_HOME folder for the import - add the scala nature to logback-core project: (right click on logback-core project -> Configure -> Add Scala Nature) - remove the logback-classic/target/generated-sources/groovy-sttubs/main directory from the list of source folders (logback-classic -> project properties -> Java Build Path) - clean all projects in Eclipse (Project -> Clean) - Select logback-classic project and convert it to "Groovy project" (right click on logback-classic project -> Configure -> Convert Groovy to Project) That's it. Please let me know if the above works for you. -- Ceki http://twitter.com/#!/ceki ps: The above also works for Helios. The only difference is that the Groovy-Eclipse feature needs to be installed from http://dist.springsource.org/release/GRECLIPSE/e3.6/

On 28 October 2011 22:35, ceki <ceki@qos.ch> wrote:
Hi All,
Here are step by step instruction for building logback under Eclipse in 61 easy steps. ... - Install Groovy-Eclipse Feature from http://dist.springsource.org/release/GRECLIPSE/e3.7/
That's available directly from the Eclipse Marketplace, FWIW. ...
- Run 'mvn eclipse:eclipse' in $LOGBACK_HOME
I'd suggest making that 'mvn eclipse:clean eclipse:eclipse', just in case there's anything that should have been tidied up that wasn't. However, I also hit a bit of a chicken & egg scenario, here ... [INFO] Building Logback Classic Module ... [INFO] Failed to resolve artifact. Missing: ---------- 1) ch.qos.logback:logback-core:jar:1.0.0-SNAPSHOT i.e. I couldn't create a build environment for logback-classic until I had logback-core in place. Knowing that the API hadn't changed, I simply downloaded logback-core-0.9.30.jar and installed it temporarily as 1.0.0-SNAPSHOT; mvn install:install-file -DgroupId=ch.qos.logback -DartifactId=logback-core -Dversion=1.0.0-SNAPSHOT -Dpackaging=jar -Dfile=logback-core-0.9.30.jar
That's it. Please let me know if the above works for you.
I had to remove and then add back the JRE1.5 system libraries to the build path to get rid of a number of errors along the lines of "Access restriction on <class> due to restriction on required library rt.jar". Google suggests this is a common problem/resolution with any newly imported JDK1.5 Eclipse project where the default JDK for Eclipse is 1.6. However, Eclipse is still highlighting errors (27 in total) against all the Groovy files; a typical example is Description: Groovy:Apparent variable 'Introspector' was found in a static scope but doesn't refer to a local variable, static field or class. Possible causes: Resource: PropertyUtil.groovy Path: /logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer Location: line 30 Type: Java Problem So I suspect that my Eclipse install isn't quite right. However, the good news is that "mvn install" from the command line is perfectly happy with the Groovy files , and will happily build, package and install everything locally, so it's pretty damn close to working (*). (*) OK, so there was one test failure in logback-core; I'll raise a ticket/submit a pull request for it, as I believe it is trivial. Greg

On 29 October 2011 18:51, Greg Thomas <greg.d.thomas@gmail.com> wrote:
(*) OK, so there was one test failure in logback-core; I'll raise a ticket/submit a pull request for it, as I believe it is trivial.
http://jira.qos.ch/browse/LBCORE-231 raised. I didn't submit a fix, as I'm not convinced I understand what's going on here, so I need to sit down and work it out ... Greg
participants (2)
-
ceki
-
Greg Thomas