[logback-dev] Building logback under Eclipse in 61 easy steps.

Greg Thomas greg.d.thomas at gmail.com
Sat Oct 29 19:51:10 CEST 2011


On 28 October 2011 22:35, ceki <ceki at 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


More information about the logback-dev mailing list