Help with using Atlassian's Bamboo, Atlassian's Clover2, Maven2 and GWT

85 views
Skip to first unread message

Brian H. Mayo

unread,
Feb 19, 2009, 12:44:50 PM2/19/09
to gwt-maven
We are trying to setup our Continuous Integration environment and have
hit a bit of a snag.

We are running Atlassian's Bamboo CI server. We have a parent project
with child modules. We have a Web module with GWT. We use Maven2 for
our build and dependency management. We are using Clover2 to handle
our code coverage reporting.

In the lifecycle of Clover, at one point it instruments all code and
calls compile. When it does this, the GWT Maven plugin attempts to
compile the code into the Javascript. Since the code is fully
instrumented, I get an error that it wants the source code for the
Clover classes.

I am not sure what to do here, I image I can just simply put excludes
in for all of the GWT client code that would participate in a Java to
Javascript compile, but I do not want to do that (not even sure if
that will work the way I am thinking).

Anybody out there with the same issue that has a work-around?

Charlie Collins

unread,
Feb 19, 2009, 6:50:46 PM2/19/09
to gwt-maven
Your chances of getting coverage information are next to zero. Just
leave your GWT projects out of the code coverage mix, for now. The
GWT team is making this easier in GWT 1.6, but even then they use
Emma, and I am not sure if it will work with Clover. (I would like to
see it work with any coverage tool, and they may be working on that
too, not sure.)

The GWTCompiler isn't a regular compiler, of course, and GWTTestCases
are compiled and run by IT, not by regular javac. Even instrumenting
classloaders can't get to the JDT stuff the 1.5 and under compiler is
using.

Here is a little more about the Emma support:
http://code.google.com/p/google-web-toolkit/wiki/EmmaSupport.

I have used Emma with 1.5, with the patch, and my patch for the patch,
but it's a long story:
http://code.google.com/p/google-web-toolkit/issues/detail?id=779 (note
that that says FixedNotReleased, maybe 1.6M1 would help, but it still
seems Emma focused to me)

Brian H. Mayo

unread,
Feb 20, 2009, 6:45:35 AM2/20/09
to gwt-maven
Actually, I was successful late yesterday getting Clover to run end-to-
end.

I looked up "the other" GWT maven plug in: http://mojo.codehaus.org/gwt-maven-plugin/

This plugin has the ability for you to *not* specify the module and it
will "scan" for them. You must have both a src/main/java and src/main/
resources directory.
Given the way that Clover works, it does not copy over the *.gwt.xml
files unless you do a little something extra. Thus, During the part
of the Clover lifecycle after it has instrumented the .java files and
called the compile part of the plugin, due to the fact that no
*.gwt.xml files exists, the compile does nothing and the flow
continues on.

The reporting is fine since Clover instruments the java source code
and "listens" in on the execution of the tests. Even though GWT has
it own specific way of running the tests, with the source code
instrumented, Clover is able to capture the coverage data.

I would suggest adding this feature to this plugin as well. If I have
time I will pull down the code, code it up, and submit it for
consideration.

Regards,
-Brian H. Mayo

Charlie Collins

unread,
Feb 20, 2009, 3:43:02 PM2/20/09
to gwt-maven
Well, if you got it working, I stand corrected then. Are you sure you
are getting coverage for your GWT client code, based on GWTTestCase
tests?

If Clover is instrumenting SOURCE, then yes, that would work, but I
have never heard of that approach (and haven't used Clover in a few
years, every other code coverage tool I have use instrumented the
bytecode). So if it makes a COPY of the source, instruments there, and
then passes that to the compiler somehow, maybe, but that seems
extremely unlikely. The issues with instrumenting the GWT compiled
classes are that even if you compile them yourself and instrument
them, those aren't the ones GWT uses (the GWTCompiler does it's own
pass), and if you try to use an instrumenting classloader, that
doesn't have access either, in my experience (the compiler does it's
own classpath manipulation too).

If you really have it working, then kudos, great job - but you will
forgive me if I am a bit skeptical (it might run fine, meaning not
blow up, but does it really report coverage info correctly?).

Also, you don't need to worry about the patch, I am a committer on the
other plugin too, and am planning to merge this plugin in there at
some point. If you got it working with the Mojo plugin, just use that
one.

Charlie Collins

unread,
Feb 20, 2009, 3:46:46 PM2/20/09
to gwt-maven
Ok, I decided to look a little closer at Clover, and I am impressed,
and my skepticism is rightly curtailed ;).

Looks like it does instrument source - and if that's the case
basically all the problems go away. If the source is instrumented, you
should be able to get it to work with any tools, just point the
compiler at the instrumented source.

Arthur Kalmenson

unread,
Feb 20, 2009, 4:24:49 PM2/20/09
to gwt-...@googlegroups.com
Wow, that's really cool! I wish it wasn't so expensive (we're a non-profit).

--
Arthur Kalmenson

Nick Pellow

unread,
Apr 16, 2009, 12:59:56 AM4/16/09
to gwt-maven
Hi Brian,

Glad to hear you managed to get Clover working with the GWT maven
plugin.

I would love to include that information in a FAQ entry in the Clover
documentation.
Did it basically just work out of the box for you, or were any extra
steps required apart from ensuring there was a
src/main/java and a src/main/resources directory?

Also, a patch for allowing the gwt:compile to be skipped has already
been committed to the maven-googlewebtoolkit2-plugin I believe:
http://code.google.com/p/gwt-maven/issues/detail?id=197

Looking forward to having these two plugins merged into one!

@Arthur - Please note that Atlassian offer free licenses of all their
products (including Clover) to non-profits and open source projects.
Application forms for these are online:
http://www.atlassian.com/software/views/community-license-request.jsp
http://www.atlassian.com/software/views/opensource-license-request.jsp

Best Regards
Nick Pellow
Atlassian - Clover


On Feb 21, 7:24 am, Arthur Kalmenson <arthur.k...@gmail.com> wrote:
> Wow, that's really cool! I wish it wasn't so expensive (we're a non-profit).
>
> --
> Arthur Kalmenson
>
> On Fri, Feb 20, 2009 at 3:46 PM, Charlie Collins
>
> <charlie.coll...@gmail.com> wrote:
>
> > Ok, I decided to look a little closer atClover, and I am impressed,
> > and my skepticism is rightly curtailed ;).
>
> > Looks like it does instrument source - and if that's the case
> > basically all the problems go away. If the source is instrumented, you
> > should be able to get it to work with any tools, just point the
> > compiler at the instrumented source.
>
> > On Feb 20, 3:43 pm, Charlie Collins <charlie.coll...@gmail.com> wrote:
> >> Well, if you got it working, I stand corrected then. Are you sure you
> >> are getting coverage for your GWT client code, based on GWTTestCase
> >> tests?
>
> >> IfCloveris instrumenting SOURCE, then yes, that would work, but I
> >> have never heard of that approach (and haven't usedCloverin a few
> >> years, every other code coverage tool I have use instrumented the
> >> bytecode). So if it makes a COPY of the source, instruments there, and
> >> then passes that to the compiler somehow, maybe, but that seems
> >> extremely unlikely. The issues with instrumenting the GWT compiled
> >> classes are that even if you compile them yourself and instrument
> >> them, those aren't the ones GWT uses (the GWTCompiler does it's own
> >> pass), and if you try to use an instrumenting classloader, that
> >> doesn't have access either, in my experience (the compiler does it's
> >> own classpath manipulation too).
>
> >> If you really have it working, then kudos, great job - but you will
> >> forgive me if I am a bit skeptical (it might run fine, meaning not
> >> blow up, but does it really report coverage info correctly?).
>
> >> Also, you don't need to worry about the patch, I am a committer on the
> >> other plugin too, and am planning to merge this plugin in there at
> >> some point. If you got it working with the Mojo plugin, just use that
> >> one.
>
> >> On Feb 20, 6:45 am, "Brian H. Mayo" <brian.h.m...@gmail.com> wrote:
>
> >> > Actually, I was successful late yesterday gettingCloverto run end-to-
> >> > end.
>
> >> > I looked up "the other" GWT maven plug in:http://mojo.codehaus.org/gwt-maven-plugin/
>
> >> > This plugin has the ability for you to *not* specify the module and it
> >> > will "scan" for them.  You must have both a src/main/java and src/main/
> >> > resources directory.
> >> > Given the way thatCloverworks, it does not copy over the *.gwt.xml
> >> > files unless you do a little something extra.  Thus, During the part
> >> > of theCloverlifecycle after it has instrumented the .java files and
> >> > called the compile part of the plugin, due to the fact that no
> >> > *.gwt.xml files exists, the compile does nothing and the flow
> >> > continues on.
>
> >> > The reporting is fine sinceCloverinstruments the java source code
> >> > and "listens" in on the execution of the tests.  Even though GWT has
> >> > it own specific way of running the tests, with the source code
> >> > instrumented,Cloveris able to capture the coverage data.
>
> >> > I would suggest adding this feature to this plugin as well.  If I have
> >> > time I will pull down the code, code it up, and submit it for
> >> > consideration.
>
> >> > Regards,
> >> > -Brian H. Mayo
>
> >> > On Feb 19, 6:50 pm, Charlie Collins <charlie.coll...@gmail.com> wrote:
>
> >> > > Your chances of getting coverage information are next to zero.  Just
> >> > > leave your GWT projects out of the code coverage mix, for now.  The
> >> > > GWT team is making this easier in GWT 1.6, but even then they use
> >> > > Emma, and I am not sure if it will work withClover.  (I would like to
> >> > > see it work with any coverage tool, and they may be working on that
> >> > > too, not sure.)
>
> >> > > The GWTCompiler isn't a regular compiler, of course, and GWTTestCases
> >> > > are compiled and run by IT, not by regular javac. Even instrumenting
> >> > > classloaders can't get to the JDT stuff the 1.5 and under compiler is
> >> > > using.
>
> >> > > Here is a little more about the Emma support:http://code.google.com/p/google-web-toolkit/wiki/EmmaSupport.
>
> >> > > I have used Emma with 1.5, with the patch, and my patch for the patch,
> >> > > but it's a long story:http://code.google.com/p/google-web-toolkit/issues/detail?id=779(note
> >> > > that that says FixedNotReleased, maybe 1.6M1 would help, but it still
> >> > > seems Emma focused to me)
>
> >> > > On Feb 19, 12:44 pm, "Brian H. Mayo" <brian.h.m...@gmail.com> wrote:
>
> >> > > > We are trying to setup our Continuous Integration environment and have
> >> > > > hit a bit of a snag.
>
> >> > > > We are running Atlassian's Bamboo CI server.  We have a parent project
> >> > > > with child modules.  We have a Web module with GWT.  We use Maven2 for
> >> > > > our build and dependency management.  We are using Clover2 to handle
> >> > > > our code coverage reporting.
>
> >> > > > In the lifecycle ofClover, at one point it instruments all code and

Arthur Kalmenson

unread,
Apr 16, 2009, 9:13:55 AM4/16/09
to gwt-...@googlegroups.com
> @Arthur - Please note that Atlassian offer free licenses of all their
> products (including Clover) to non-profits and open source projects.
> Application forms for these are online:
> http://www.atlassian.com/software/views/community-license-request.jsp
> http://www.atlassian.com/software/views/opensource-license-request.jsp

Hehe, I've already applied and got license :). I'm really looking
forward to setting up the Atlassian products :D.

I still need to migrate to the Mojo plugin because Clover doesn't work
with the Google Code plugin (actually it crashes). I'll post back when
I get a chance to do that.

--
Arthur Kalmenson
Reply all
Reply to author
Forward
0 new messages