Re: cobertura m2 plugin: newbie question
Hi, Have you looked at the M2 cobertura plugin at http://jira.codehaus.org/browse/MOJO-127 ? Its not released yet, but it works. Patrick Mathieu Vanderwhale <[EMAIL PROTECTED]> 01/09/2006 10:10 AM Please respond to "Maven Users List" To "Maven Users List" cc Subject Re: cobertura m2 plugin: newbie question Hi Laurie, Hi faced problems with the Cobertura plugin for M2 as well. I tried some tricks but I finally gave up. And reading some Cobertura news on the Net, it seems the Cobertura developpers are working on this plugin for Maven 2. So I decided to find another solution : integrate a Cobertura ant task in my pom.xml. I know it is a little bit against the Maven philosophy but while the Cobertura plugin is not working, I think this is the only solution to your problem. Here is a part of my pom.xml : org.apache.maven.plugins maven-surefire-plugin true maven-antrun-plugin test run As you can see, you must skip the test executed by Maven, otherwise, the tests will be executed twice. Hi called my Cobertura ant task 'cobertura' in my build.xml so it can be referenced by my target in my pom.xml. If not alredy done, I advise you to subscribe to the Cobertura mailing list : [EMAIL PROTECTED] Enjoy, Le Jan 6, 2006, à 11:19 PM, Laurie Tynor a écrit : > > > > > I'm pretty new to maven, so this may be an obvious question to those > with more experience. I have looked through all the docs however, and > am unable to resolve it, and would appreciate any help/information. > > I am using maven2 (2.0.1) and am trying to get the cobertura plugin to > work. I am able to run cobertura under ant, but not with maven2. > > Our build directory uses maven modules. It's structure is like this: > main/ > main/pom.xml (which has module declarations for core, etc) > main/core/ > main/core/pom.xml (which has some additional dependencies for core > classes) > > > The pom.xml in the main level produces no artifacts. The main > directory has no classes just has a few subdirectories. The > subdirectories have the classes, resources, and unit tests. The > main-level pom.xml has the surefire plugin, which is working fine > traversing the subdirectories. > > > Here are the details for my cobertura attempts. Any help is > appreciated: > > 1. Version from the svn sandbox (which uses cobertura 1.7), and > specifies the instrument goal in the lifecycle.xml file as part of the > process-classes phases: > > a) When I call "mvn install", which should trigger the > instrumentation goal, nothing happens. It looks like > instrumentation is not attempted > > b) When I call "mvn site", I get this null-pointer exception > (which I think is because the target/generated-classes directory was > never produced from the mvn install): > [INFO]task-segment: [site] > [INFO] > --- > -- > --- > [INFO] Preparing surefire-report:report > [INFO] No goals needed for project - skipping > [INFO] Preparing cobertura:cobertura > [INFO] > --- > -- > --- > [ERROR] FATAL ERROR > [INFO] > --- > -- > --- > [INFO] null > [INFO] > --- > -- > --- > [INFO] Trace > java.lang.NullPointerException > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor > (DefaultLifecycleExecutor.java:884) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecy > cle(DefaultLifecycleExecutor.java:842) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(Def > aultLifecycleExecutor.java:729) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa > ultLifecycleExecutor.java:521) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi > > > > c) When I try to call the instrument target directly, I get a > "BUILD ERROR" that says "Unable to prepare instrumentation > directory. Source directory doesn't exist". The > target/generated-classes/cobertura directory is created so I can > tell that it did try to instrument > > > > 2. Version from the maven auto-download. This one uses cobertura 1.6, > and specifies instrumentation as part of the generate-sources phase > (which I don't think is correct): > > a) When I call "mvn install", which should trigger the > instrumentation goal, nothing happens as with the sandbox versio
RE: [m2]release:prepare requires snapshots ?
Hi, I perform a cvs compare before i run the release:prepare and everything is ok. The problem is that the release:prepare plugin itself changes the second childs pom.xml without checking it in and this then causes the cvs compare run as aprt of the release:prepare to fail Should i raise a Jira issue for this ? thanks Patrick "Michael Fiedler" <[EMAIL PROTECTED]> 01/06/2006 08:42 PM Please respond to "Maven Users List" To "Maven Users List" cc Subject RE: [m2]release:prepare requires snapshots ? Patrick, I usually perform a synch or compare before executing the release:prepare. I agree that a failure or user abort during that goal is not transactional in nature. I know that checkpoints exist in the release.properties file, but I am not comfortable enough with them to count on it working right every time. I usually blow that file away and start over. On the bright side, once you can get through it, the process is nicer than the manual alternatives. Michael -Original Message- From: Patrick O'shea [mailto:[EMAIL PROTECTED] Sent: Friday, January 06, 2006 10:05 AM To: Maven Users List Subject: RE: [m2]release:prepare requires snapshots ? Hi, Is there an issue with release:prepare when running against multiple projects ? I'm running this against a parent project with two child projects. When release:prepare runs from the parent project it runs correctly against the first child project and updates the version numbers in the poms to the new numbers. However because the second child project has a reference to both the parent project (through tags) and a dependency on the first child project it will fail the cvs diff that is part of the release:prepare. This is because during the execution of the release:prepare on the first child, it modified the second childs pom.xml with the new version numbers and didn't check second project pom.xml. Has anyone else managed to sucessfully perform a release:prepare under similar conditions ? thanks patrick "Mike Perham" <[EMAIL PROTECTED]> 01/04/2006 03:48 PM Please respond to "Maven Users List" To "Maven Users List" cc Subject RE: [m2]release:prepare requires snapshots ? I think the idea is that if you are releasing an entire set of projects at once, you would want to keep their versions in sync. If you want to do what you say below (which is what we want to do also), you just do finer grained releases. You don't do recursive releases but only release those modules which have changed. mike -Original Message- From: Laurent Berteau [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 04, 2006 5:06 AM To: Maven Users List Subject: Re: [m2]release:prepare requires snapshots ? Hi, dan tran wrote: > It follows maven development process where > > - during development, every one works on snapshots > > - at release time, the snapshost got changed to release version, > check back into SCM, label, and build. > This is where customer can use, including qa, stake holder, etc > > - then the version is increamented with snapshot and check into SCM again. This implies that in a multi-module project, every sub-module version number is incremented even if no changes has been made. I have a multi-module project where some modules do not evolve frequentely whereas some do. I do not want to overload the repository and the scm history with different version of exactly the same code. Is the only solution to run the release plugin against each module independently ? Do my way of thinking does not fit with the maven approach of the release policy ? Best regards, -- Laurent Berteau - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [m2]release:prepare requires snapshots ?
Hi, Is there an issue with release:prepare when running against multiple projects ? I'm running this against a parent project with two child projects. When release:prepare runs from the parent project it runs correctly against the first child project and updates the version numbers in the poms to the new numbers. However because the second child project has a reference to both the parent project (through tags) and a dependency on the first child project it will fail the cvs diff that is part of the release:prepare. This is because during the execution of the release:prepare on the first child, it modified the second childs pom.xml with the new version numbers and didn't check second project pom.xml. Has anyone else managed to sucessfully perform a release:prepare under similar conditions ? thanks patrick "Mike Perham" <[EMAIL PROTECTED]> 01/04/2006 03:48 PM Please respond to "Maven Users List" To "Maven Users List" cc Subject RE: [m2]release:prepare requires snapshots ? I think the idea is that if you are releasing an entire set of projects at once, you would want to keep their versions in sync. If you want to do what you say below (which is what we want to do also), you just do finer grained releases. You don't do recursive releases but only release those modules which have changed. mike -Original Message- From: Laurent Berteau [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 04, 2006 5:06 AM To: Maven Users List Subject: Re: [m2]release:prepare requires snapshots ? Hi, dan tran wrote: > It follows maven development process where > > - during development, every one works on snapshots > > - at release time, the snapshost got changed to release version, > check back into SCM, label, and build. > This is where customer can use, including qa, stake holder, etc > > - then the version is increamented with snapshot and check into SCM again. This implies that in a multi-module project, every sub-module version number is incremented even if no changes has been made. I have a multi-module project where some modules do not evolve frequentely whereas some do. I do not want to overload the repository and the scm history with different version of exactly the same code. Is the only solution to run the release plugin against each module independently ? Do my way of thinking does not fit with the maven approach of the release policy ? Best regards, -- Laurent Berteau - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2]release:prepare requires snapshots ?
Hi, Should i be able to do a release:prepare from a parent project ? If the parent project does not have a snapshot version number, then it will fail. But if the parent has a snapshot number then it will fail when it runs the release:prepare at the child project because it can't release due to a non released parent. thanks patrick dan tran <[EMAIL PROTECTED]> 12/22/2005 08:52 PM Please respond to "Maven Users List" To Maven Users List cc Subject Re: [m2]release:prepare requires snapshots ? It follows maven development process where - during development, every one works on snapshots - at release time, the snapshost got changed to release version, check back into SCM, label, and build. This is where customer can use, including qa, stake holder, etc - then the version is increamented with snapshot and check into SCM again. -Dan On 12/22/05, Patrick O'shea <[EMAIL PROTECTED]> wrote: > > > Hi, > > I'm am trying to use the release:prepare goal. > I can see from the source code that it is supposed to throw an exception > if the project being release is not a snapshot. > Why is this ? > > > Kind regards, > Patrick O'Shea > > > > >
[m2]release:prepare requires snapshots ?
Hi, I'm am trying to use the release:prepare goal. I can see from the source code that it is supposed to throw an exception if the project being release is not a snapshot. Why is this ? Kind regards, Patrick O'Shea
[m2] stop password being requested on site deploy
Hi, I want to deploy a site without any user interaction, currently it asks me for a password even though it is in the settings.xml In my pom.xml i have defined: scmsite deploy site scp://cassiusgroup-3.internal.org/var/www/projname/ And in the settings.xml i have defined: scmsite po82266 po82266 Is there something else, i'm missing ? thanks Patrick
[m2] delete file
Hi, Is there a plugin available, or what is the best way to delete a file during a maven build ? thanks patrick
RE: {m2] plugin execution order
Hi, When i have multiple plugins for the same phase in a profile in a single pom, they don't get executed in the correct order . thanks, Patrick O'Shea "David Jackman" <[EMAIL PROTECTED]> 12/15/2005 06:39 PM Please respond to "Maven Users List" To "Maven Users List" cc Subject RE: {m2] plugin execution order Plugins that are executed with any given phase can come from three places: they can be associated with the phase by the definition of the packaging type for your project, they can come from the parent pom, and they can be given in your pom. According to the docs, the plugins from the packaging are run first, followed by the plugins listed in the parent pom, followed by the plugins listed in your pom. For those groups, the plugins are supposed to be run in the order they are declared. However, in Maven 2.0, reality proved otherwise. When I ran the phase with plugins coming from both the parent and my pom, the order was incorrect (but when I only had plugins listed in one of the two poms it worked correctly). I filed http://jira.codehaus.org/browse/MNG-1499, which was fixed in Maven 2.0.1. Are you seeing ordering problems in Maven 2.0.1? ..David.. ____ From: Patrick O'shea [mailto:[EMAIL PROTECTED] Sent: Thursday, December 15, 2005 10:21 AM To: Maven Users List Subject: RE: {m2] plugin execution order Hi, it just means that i can configure a plugin to a phase in the pom.xml, like the following: org.apache.maven.plugins maven-site-plugin deploy-site install deploy The problem I have, is that I have multiple plugins with executions configured to the install phase, and the order they are run in is not the order they appear in the pom.xml thanks, Patrick O'Shea "Christopher Cobb" <[EMAIL PROTECTED]> 12/15/2005 06:10 PM Please respond to "Maven Users List" To "'Maven Users List'" cc Subject RE: {m2] plugin execution order I just read this: "you can use the executions element to gain more control over the order of particular goals" http://maven.apache.org/guides/introduction/introduction-to-the-lifecycl e.ht ml (Plugins section) Of course, I have no clue what that actually means. -Original Message- From: Patrick O'shea [mailto:[EMAIL PROTECTED] Sent: Thursday, December 15, 2005 11:42 AM To: Maven Users List Subject: {m2] plugin execution order Hi, If i have multiple plugins running in the same phase, How do i control the order that they are run ? thanks in advance Patrick O'Shea - Attention: Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you received this in error, please contact the sender and delete the material from any system and destroy any copies. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: {m2] plugin execution order
Hi, it just means that i can configure a plugin to a phase in the pom.xml, like the following: org.apache.maven.plugins maven-site-plugin deploy-site install deploy The problem I have, is that I have multiple plugins with executions configured to the install phase, and the order they are run in is not the order they appear in the pom.xml thanks, Patrick O'Shea "Christopher Cobb" <[EMAIL PROTECTED]> 12/15/2005 06:10 PM Please respond to "Maven Users List" To "'Maven Users List'" cc Subject RE: {m2] plugin execution order I just read this: "you can use the executions element to gain more control over the order of particular goals" http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.ht ml (Plugins section) Of course, I have no clue what that actually means. -Original Message- From: Patrick O'shea [mailto:[EMAIL PROTECTED] Sent: Thursday, December 15, 2005 11:42 AM To: Maven Users List Subject: {m2] plugin execution order Hi, If i have multiple plugins running in the same phase, How do i control the order that they are run ? thanks in advance Patrick O'Shea - Attention: Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you received this in error, please contact the sender and delete the material from any system and destroy any copies. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
{m2] plugin execution order
Hi, If i have multiple plugins running in the same phase, How do i control the order that they are run ? thanks in advance Patrick O'Shea
Re: [m2] deploy phase
Hi, How do you stop your the plugin running when you do a normal mvn install ? thanks patrick Kenney Westerhof <[EMAIL PROTECTED]> 12/15/2005 02:30 PM Please respond to "Maven Users List" To Maven Users List cc Subject Re: [m2] deploy phase On Thu, 15 Dec 2005, Patrick O'shea wrote: Hi, > Hi, > > > Is there a way to use the deploy phase to perform some tasks (I'm > uploading the built artifact to a non maven repository), > without maven trying to install the artifact to a maven repository, > which is giving me errors because i don't have any info in > the . If you run 'mvn deploy', the 'maven-deploy-plugin' kicks in. There's no flag that tells it not to upload the file. So you'd have to make a new lifecycle mapping/packaging for each of artifact in your project. AFAIK there's no way to 'delete' mojo's from the default lifecycle. What you could do is specify the remote repo as file:///tmp or something. Usually people want to 'upload' a war to the tomcat webapps dir, also known as deploying. That kind of deploying is not something m2 has a phase for. What I do is I create a profile in the pom (or super pom), and add a task/mojo/whatever to the 'install' phase. For instance, I have the antrun plugin copy the artifact to the tomcat directory (its location specied in settings.xml). The profile is named 'dev', so whenever I want to deploy a war, I just type 'mvn install -Pdev'. I think a similar solution should work for you: don't bind to the deploy phase, but to the install or package phase. -- Kenney > > > thanks in advance > Patrick O'Shea > > -- Kenney Westerhof http://www.neonics.com GPG public key: http://www.gods.nl/~forge/kenneyw.key - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[m2] deploy phase
Hi, Is there a way to use the deploy phase to perform some tasks (I'm uploading the built artifact to a non maven repository), without maven trying to install the artifact to a maven repository, which is giving me errors because i don't have any info in the . thanks in advance Patrick O'Shea
[m2] dependencies of a plugin
Hi, Is it possible to get the dependencies of a plugin that i have in my project. I can get a reference to the plugin using mavenProject.getDependencyArtifacts(); but how do i get access all the plugins dependencies ? thanks, Patrick
[m2] fork to run junit tests
Hi, Is it possible to fork to run the junit tests ? I'm using external code that is called when the forked jvm exits after the tests are run. thanks in advance Patrick
Re: [m2] tests running twice
thanks Nik, that worked. Patrick Nik Gonzalez <[EMAIL PROTECTED]> 22-11-2005 10:10 Please respond to "Maven Users List" To Maven Users List cc Subject Re: [m2] tests running twice Hi, Try bringing the configuration tag out from the executions tag. Then, delete the executions tag... You'll have something that looks like the ff: org.apache.maven.plugins maven-surefire-plugin 2.0 net.sourceforge.cobertura.datafile C:\cobertura.ser hth, Nik Patrick O'shea wrote: >Hi, > >I've added config for the surefire plugin below, to add a system property >needed for testing. >If i run the tests (mvn test) all the tests are run twice, >The first time it doesn't pass the system property and the second time it >does. >How can I stop it running all the tests the first time ? > >thanks in advance, >Patrick > > > org.apache.maven.plugins > maven-surefire-plugin > 2.0 > > >test-classes > test > > > > net.sourceforge.cobertura.datafile >C:\cobertura.ser > > > > > >test > > > > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[m2] tests running twice
Hi, I've added config for the surefire plugin below, to add a system property needed for testing. If i run the tests (mvn test) all the tests are run twice, The first time it doesn't pass the system property and the second time it does. How can I stop it running all the tests the first time ? thanks in advance, Patrick org.apache.maven.plugins maven-surefire-plugin 2.0 test-classes test net.sourceforge.cobertura.datafile C:\cobertura.ser test