Bug 663517 - cobetura and ant are now dependencies which causes runtime errors
Summary: cobetura and ant are now dependencies which causes runtime errors
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Build System
Version: 4.0.0.B02
Hardware: All
OS: All
low
low
Target Milestone: ---
: ---
Assignee: Filip Drabek
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: jon30-bugs 663236
TreeView+ depends on / blocked
 
Reported: 2010-12-16 02:26 UTC by John Mazzitelli
Modified: 2013-09-02 07:23 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-09-02 07:23:50 UTC
Embargoed:


Attachments (Terms of Use)

Description John Mazzitelli 2010-12-16 02:26:21 UTC
In the root pom.xml, there is this dependency:

    <dependency>
      <groupId>net.sourceforge.cobertura</groupId>
      <artifactId>cobertura</artifactId>
      <version>1.9.4.1</version>
    </dependency>

Notice it is using the default scope (compile). This causes coberture and its dependencies (ant 1.7) to get packaged in the RHQ Server in several places (the installer war and the ear itself are two such places - but it is in several more).

This causes problems. One problem showed itself in the bundle subsystem (the bundle subsystem has a server side ant bundle plugin that has its own Ant library (v1.8). But because the root classloader now has 1.7 inside it, it breaks the bundle plugin - see bug 663236 for more).

Since cobertura is only needed during the testing phase, there is no need to package its jar and its ant dependency in the RHQ Server (and as we've seen, we can't have ant in the server or errors occur). Therefore, cobertura needs to be in the test scope via <scope>test</scope>:

    <dependency>
      <groupId>net.sourceforge.cobertura</groupId>
      <artifactId>cobertura</artifactId>
      <version>1.9.4.1</version>
      <scope>test</scope>
    </dependency>

NOTE: the git commit that introduced the bug is:

9972429183bee20d1a973eae55c1c9b75832b546

I git checked out that commit, added the one <scope> line to the root pom.xml and ran a test to confirm this does indeed fix the runtime error in the bundle subsystem. However, I have no idea if this breaks the cobertura tests, or maven test builds. However, because this is a blocker for us (it breaks the bundle subsystem - you can't create new bundles in the system without this fix; this is blocking me from doing more bundle work), we need to do this now. Someone will have to go in and verify that cobertura still works in the test infrastructure and if it doesn't, fix it.

I am using maven 2.2.1 when building the server for these tests. It appears that the test scope was not included possibly due to some maven 3 bug (as the commit message for sha 997242 indicates: "test scope removed because of maven3
"). If this is true, we will need to work around that bug some other way or not allow maven 3 to be used for our builds.

Comment 1 John Mazzitelli 2010-12-16 03:23:54 UTC
i put the cobertura scope at test - git commit 

b37f3e2278ca08f5eddb43e275e300642fa9d850

someone more familiar with cobertura needs to make sure this doesn't break anything.

Comment 2 John Mazzitelli 2010-12-16 03:27:20 UTC
assigning Filip to look at this since he is most familiar with the cobertura setup in the build.

Comment 3 Filip Drabek 2011-01-12 15:56:00 UTC
Cobertura task works with maven 2.2.1.

Comment 4 Mike Foley 2011-05-24 14:38:55 UTC
verified through general testing of the build.  agree on the approach.

Comment 5 Heiko W. Rupp 2013-09-02 07:23:50 UTC
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.


Note You need to log in before you can comment on or make changes to this bug.