Red Hat Bugzilla – Bug 663517
cobetura and ant are now dependencies which causes runtime errors
Last modified: 2013-09-02 03:23:50 EDT
In the root pom.xml, there is this 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>:
NOTE: the git commit that introduced the bug is:
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.
i put the cobertura scope at test - git commit
someone more familiar with cobertura needs to make sure this doesn't break anything.
assigning Filip to look at this since he is most familiar with the cobertura setup in the build.
Cobertura task works with maven 2.2.1.
verified through general testing of the build. agree on the approach.
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.