From: Jared R. <Jar...@sa...> - 2005-04-01 17:24:19
|
Thanks Charles!=20 =20 > -----Original Message----- > From: Charles Blaxland [mailto:Cha...@eb...]=20 > Sent: Thursday, March 31, 2005 9:05 PM > To: Jared Richardson > Cc: cob...@li... > Subject: Re: [Cobertura-devel] Maven plugin >=20 > Hi Jared, >=20 > Here's a bit of a maven plugin primer for you. In summary, until the=20 > cobertura plugin can be distributed as part of the maven project, I=20 > would add the source for the plugin into the cobertura CVS=20 > tree, build=20 > the plugin, and make it available for users to download from the=20 > cobertura website using "maven plugin:download". You may=20 > also like to=20 > make the plugin's dependencies available somehow. Details on=20 > how to do=20 > all this below... >=20 >=20 > Building the Plugin > ------------------- > The zip that I uploaded to JIRA is the source for the cobertura maven=20 > plugin. To use it it needs to be packaged into a jar. You=20 > can do this=20 > by running "maven plugin:install". This will package it up in a jar=20 > (target/maven-cobertura-plugin-1.0.0.jar) and put it in your maven=20 > plugin dir ($MAVEN_HOME/plugins). Alternatively you could probably=20 > simply rename the zip I uploaded to a jar and manually copy it to the=20 > plugins dir. >=20 >=20 > Distributing the plugin > ----------------------- > Eventually you probably want to lobby the maven project to have the=20 > cobertura plugin distributed along with the maven releases,=20 > and have the=20 > source hosted and maintained as part of the maven project. =20 > Given that=20 > this process will take some time, and maven releases are pretty=20 > infrequent, you probably want to make it available from the cobertura=20 > website in the interim. To do this: > - Build the plugin > - Put the build plugin in a directory=20 > "maven/cobertura/plugins" on the=20 > cobertura website. > - Users should now be able to download the plugin with the following=20 > command: > maven=20 > -Dmaven.repo.remote=3Dhttp://www.ibiblio.org/maven,http://cobert > ura.sourceforge.net/maven=20 > -DgroupId=3Dcobertura -DartifactId=3Dmaven-cobertura-plugin=20 > -Dversion=3D1.0.0=20 > plugin:download > - The plugin should then be available for use. >=20 >=20 > Dependencies > ------------ > Maven downloads all dependency jars from external repositories (eg:=20 > http://www.ibiblio.org/maven). Each dependency is identified by a=20 > groupId, a name and a version. So if maven needs a dependency with a=20 > groupId of "asm", a name of "asm" and a version "1.5.2" it=20 > will look in=20 > each external repository for a file "asm/jars/asm-1.5.2.jar". >=20 > The cobertura plugin I wrote depends on the following=20 > (groupId/name/version): > cobertura/cobertura/1.2 > asm/asm/2.0.RC1 > log4j/log4j/1.2.8 > urbanophile/java-getopt/1.0.9 > ncss/javancss/21.41 > ncss/ccl/21.41 >=20 > Of these, I couldn't find the cobertura, asm, and the ncss=20 > jars on the=20 > public maven repo (www.ibiblio.org/maven). This will cause=20 > errors when=20 > users try to run the plugin, as not all deps will be found. =20 > There are a=20 > few options to fix this: > - Tell users they need to install these dependencies into their local=20 > maven repo manually and give them instructions on how to do this. > - Upload the missing dependencies to the public maven repo on=20 > ibiblio. =20 > Not sure what the process for this is. Its probably on the=20 > maven website. > - Upload the missing dependencies to the maven repo on the cobertura=20 > website (ie: where you put the plugin). Then users will have=20 > to run the=20 > cobertura plugin with the=20 > "-Dmaven.repo.remote=3Dhttp://www.ibiblio.org/maven,http://cober > tura.sourceforge.net/maven"=20 > option at least the first time they run it so that maven can find the=20 > dependencies. >=20 >=20 > Hope this helps. >=20 > Cheers, > Charles >=20 >=20 >=20 >=20 > Jared Richardson wrote: >=20 > >Hi Charles, > > > >I'm starting to play with Maven but am not an expert (or=20 > even a good user!) yet. Should any part of your note be added=20 > to the Cobertura docs so that people know how to use the=20 > plugin or does Maven present that information to the end users? > > > >Jared > >=20 > > > > > >>-----Original Message----- > >>From: cob...@li...=20 > >>[mailto:cob...@li...] On=20 > >>Behalf Of Charles Blaxland > >>Sent: Tuesday, March 29, 2005 7:34 PM > >>To: cob...@li... > >>Subject: Re: [Cobertura-devel] Maven plugin > >> > >>Hi All, > >> > >>[I tried sending this mail previously with the plugin as an=20 > >>attachment, but it=20 > >>didn't seem to work - apologies if you get this twice. I've=20 > >>now attached the=20 > >>plugin to the maven JIRA issue at=20 > >>http://jira.codehaus.org/browse/MPJCOVERAGE-25] > >> > >>I have created a basic maven plugin for Cobertura. It is=20 > >>based on the existing=20 > >>jcoverage plugin, however it does NOT support generating its=20 > >>own HTML report=20 > >>based on the XML coverage output as the existing jcoverage=20 > >>plugin does - rather=20 > >>it simply delegates to the cobertura-report ant task to do=20 > >>this work. The=20 > >>properties you can set are a subset of the jcoverage ones: > >> > >>maven.cobertura.dir=3D${maven.build.dir}/cobertura > >>maven.cobertura.instrumentation=3D${maven.cobertura.dir}/classes > >>maven.cobertura.junit.fork=3Dyes > >>maven.cobertura.instrumentation.includes=3D**/*.class > >>maven.cobertura.instrumentation.excludes=3DNOT_DEFINED > >> > >>The "cobertura" goal will instrument, run the tests and generate the > >>report. You can include the report in the site generation in=20 > >>the usual > >>maven way. > >> > >>It depends on cobertura 1.2 at present. I couldn't find some of the > >>dependencies on the maven repo on ibiblio, so there may be a few > >>unsatisfied deps which require some manual installation when=20 > >>you run it > >>(maybe these could be distributed with the plugin?). > >> > >>I've run it over a few of my projects (incl jdk1.5 ones) and=20 > >>it seems to > >>work OK. > >> > >>Enjoy, > >>Charles > >> > >> > >> >=20 >=20 |