Re: Maven:test with Junit4
thanks to all your answers. Anders Hammar wrote: Also, when using JUnit 4, your test class should NOT extend from any JUnit class as was the case in JUnit 3. I remember a very tricky issue on this mailing list a year or so ago, where someone used JUnit 4 style annotations but the tests weren't run. The reason was that the test class extended JUnit 3's TestCase class. As Junit 4 is backwards compatible, it would compile. But it wouldn't run with the surefire plugin in Maven. /Anders On Wed, May 26, 2010 at 14:50, Nicola Musatti nicola.musa...@objectway.itwrote: Specifying a dependency to junit-4.8.1.jar with test scope works for me, as in: dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.8.1/version scopetest/scope /dependency Cheers, Nicola Musatti MartyMcFly wrote: Hi, I do have problems running Junit4 Tests with Maven surefire. Apparently it only recognizes JUnit3 testcases. So @Test or @Before annotated methods are ignored. Only if they follow the Junit3 style they are run. I have junit-dep.4.7.jar as dependencies, the tests are in src/test/java and running in Eclipse via Run As - Junit Tests work fine. The surefire plugin is version 2.4.3 Is there any way to tell surefire to run with Junit 4 ? Thanks - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org -- View this message in context: http://old.nabble.com/Maven%3Atest-with-Junit4-tp28679295p28690094.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
POM as dependency fails
Hi all, I have Project-A which defines a bunch of libraries (jar) for testing (scope compile) with packaging set to pom. This pom is available at our repository. Project-B now defines Project-A's pom as dependency ( i found that in the maven sonatype book as an advice) (scope test). All libs are at the remote and the locale repository. Nevertheless when I type mvn test at the console it fails because it cant resolve (e.g) junit which is defined in Project-A (which pom Project-B has). Funnily Project-A also has a dependency to Project-C's pom (scope compile) ... and the libs which are in that pom are resolved successfully (running mvn compile resolves it and builds successfully) Can someone somehow explain why and what might go wrong here ? Thanks for any support -- View this message in context: http://old.nabble.com/POM-as-dependency-fails-tp28690145p28690145.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: POM as dependency fails
its solved... it was a configuration issue on our side. everything works now :) MartyMcFly wrote: Hi all, I have Project-A which defines a bunch of libraries (jar) for testing (scope compile) with packaging set to pom. This pom is available at our repository. Project-B now defines Project-A's pom as dependency ( i found that in the maven sonatype book as an advice) (scope test). All libs are at the remote and the locale repository. Nevertheless when I type mvn test at the console it fails because it cant resolve (e.g) junit which is defined in Project-A (which pom Project-B has). Funnily Project-A also has a dependency to Project-C's pom (scope compile) ... and the libs which are in that pom are resolved successfully (running mvn compile resolves it and builds successfully) Can someone somehow explain why and what might go wrong here ? Thanks for any support -- View this message in context: http://old.nabble.com/POM-as-dependency-fails-tp28690145p28690903.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: buildnumber-maven-plugin, git
Adam Monsen hair...@gmail.com writes: On Thu, May 13, 2010 at 4:17 PM, Adam Monsen wrote: Some awesome folks have created a patch to the buildnumber-maven-plugin that supports Git. Apparently it works, but the integration tests do not pass. Is anyone interested in helping make the tests pass? If not, perhaps someone could offer some advice on how to debug plugin integration tests? (the following was crossposted to the git mailing list) FYI, I gave up trying to fix the integration tests, or to modify the plugin to suit my needs. I instead used groovy script right in my POM, and set project properties that are filtered into a file included in our war. -snip- FWIW: I fixed the problems with the ITs; the result can be found at http://github.com/espenhw/buildnumber-maven-plugin -- Espen Wiborg espen.wib...@telio.no - Veritas vos liberabit God grant us the serenity to accept the things we cannot change, courage to change the things we can, and wisdom to know the difference. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Lifecycle: Compile on projects with type pom
Thanks, will try it. On 05/27/2010 07:24 AM, Samuli Saarinen wrote: Hi, I used the following code in a plugin. Got it from hibernate3-maven-plugin if I remember correctly. */ * @parameter expression=${project} * @required * @readonly */ protected MavenProject project; protected boolean isJavaProject() { ArtifactHandler artifactHandler = project.getArtifact().getArtifactHandler(); return java.equals( artifactHandler.getLanguage()); } I hope this helps Cheers, Samuli Johannes Schneider wrote: The plugin is then executed correctly. But of course I don't want to runt that plugin for pom projects (with packagingpom/packaging). The maven-compile-plugin does *not* run for pom projects. At least I cannot see any output. I searched for the reason within the plugin sources but could not find them. Any ideas/hints what I could do?? Thanks, Johannes - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org -- Johannes Schneider - blog.cedarsoft.com - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven 2.0.9 to 2.2.1 and war plugin 2.1-alpha-1
2.0.9 and 2.2.1 likely lock down different versions of the WAR plugin which would yield different results. Lock down the version and then try different versions of Maven. On May 27, 2010, at 1:03 AM, Patrick Shea wrote: No, but after checking I think it could be alpha-2. Is beta-1 a fix? Patrick -Original Message- From: Jason van Zyl ja...@sonatype.com Sent: Wednesday, May 26, 2010 6:58pm To: Maven Users List users@maven.apache.org Subject: Re: Maven 2.0.9 to 2.2.1 and war plugin 2.1-alpha-1 You have the plugin version locked down in your POM? On May 27, 2010, at 12:49 AM, Patrick Shea wrote: Hi, we just recently switch from maven 2.0.9 to 2.2.1 and I noticed that the war plugin seems to be ignoring the excludes directive. We did not change the plugin, just the maven core. Any ideas? Patrick - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org Thanks, Jason -- Jason van Zyl Founder, Apache Maven http://twitter.com/jvanzyl - happiness is like a butterfly: the more you chase it, the more it will elude you, but if you turn your attention to other things, it will come and sit softly on your shoulder ... -- Thoreau - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org Thanks, Jason -- Jason van Zyl Founder, Apache Maven http://twitter.com/jvanzyl -
Assembly plugin: Same file with several file extensions?
Hi I want to include several files which have the same name, but different file extensions into a JAR. Of course, the Assembly plugin comes to mind, but is this possible? And if it is, how can I do it? The idea is that if for instance I find a file my-file.xsd, I will also look for my-file.properties. Thanks for any pointers! Best regards, Eric - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Assembly plugin: Same file with several file extensions?
Hi Eric, have you located the files you want to include into the src/main/resources folder? If yes than they should be included automatically ...May be i didn't understand what you like to do? Kind regards Karl Heinz Marbaise -- View this message in context: http://old.nabble.com/Assembly-plugin%3A-Same-file-with-several-file-extensions--tp28692233p28693892.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
AW: Assembly plugin: Same file with several file extensions?
Hi Karl Heinz Well, I've located them by specifying something like includes include**/*.xsd/include include**/*.properties/include /includes However, this gets all those files. What I need is *pairs* of files, like bla.xsd and bla.properties - or in regex: (.*)\.xsd requires $1\.properties Best regards Eric -Ursprüngliche Nachricht- Von: Karl Heinz Marbaise [mailto:k...@soebes.de] Gesendet: Donnerstag, 27. Mai 2010 15:49 An: users@maven.apache.org Betreff: Re: Assembly plugin: Same file with several file extensions? Hi Eric, have you located the files you want to include into the src/main/resources folder? If yes than they should be included automatically ...May be i didn't understand what you like to do? Kind regards Karl Heinz Marbaise -- View this message in context: http://old.nabble.com/Assembly-plugin%3A-Same-file-with-several-file-extensions--tp28692233p28693892.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Lifecycle: Compile on projects with type pom
Great. That worked. Thanks. On 05/27/2010 11:47 AM, Johannes Schneider wrote: Thanks, will try it. On 05/27/2010 07:24 AM, Samuli Saarinen wrote: Hi, I used the following code in a plugin. Got it from hibernate3-maven-plugin if I remember correctly. */ * @parameter expression=${project} * @required * @readonly */ protected MavenProject project; protected boolean isJavaProject() { ArtifactHandler artifactHandler = project.getArtifact().getArtifactHandler(); return java.equals( artifactHandler.getLanguage()); } I hope this helps Cheers, Samuli Johannes Schneider wrote: The plugin is then executed correctly. But of course I don't want to runt that plugin for pom projects (with packagingpom/packaging). The maven-compile-plugin does *not* run for pom projects. At least I cannot see any output. I searched for the reason within the plugin sources but could not find them. Any ideas/hints what I could do?? Thanks, Johannes - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org -- Johannes Schneider - blog.cedarsoft.com - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Maven Enforcer: Banned dependencies including type, classifier etc.
Hi As far as I know, most Maven plugins rely on the Maven coordinates as described in http://maven.apache.org/pom.html#Maven_Coordinates I just tried to use them in the Maven Enforcer plugin's banned dependencies rule, but from reading the source, it looks like the Maven coordinates are only supported up to the version. Am I right with this? Should I write an enhancement request? Best regards, Eric - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Modyfing classpath
Hello Everyone, My earlier email regarding problems with WAS6 plugin didn't get any traction - leads me to believe that it's not a very popular plugin. So let me ask you this: How do I modify the java classpath so it includes artifacts my pom.xml depends on? I need to make those artifacts available to a shell script that is launched from maven/WAS6 plugin. Thanks, Dave
Re: Modyfing classpath
How do I modify the java classpath so it includes artifacts my pom.xml depends on? I need to make those artifacts available to a shell script that is launched from maven/WAS6 plugin. Take a look at the dependency plugin, specifically the build-classpath mojo: http://maven.apache.org/plugins/maven-dependency-plugin/build-classpath-mojo.html It is open source so you should be able to figure it out. Your plugin needs to do something similar. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Modyfing classpath
Thanks Wayne! So my preliminary plan is to dump this classpath to a file and then pick it up from a file through shell script. Is this a good approach? Is there a better way of doing it? Dave On Thu, May 27, 2010 at 11:38 AM, Wayne Fay wayne...@gmail.com wrote: How do I modify the java classpath so it includes artifacts my pom.xml depends on? I need to make those artifacts available to a shell script that is launched from maven/WAS6 plugin. Take a look at the dependency plugin, specifically the build-classpath mojo: http://maven.apache.org/plugins/maven-dependency-plugin/build-classpath-mojo.html It is open source so you should be able to figure it out. Your plugin needs to do something similar. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Modyfing classpath
So my preliminary plan is to dump this classpath to a file and then pick it up from a file through shell script. Is this a good approach? Is there a This is a good approach because many shells have limits on string lengths and you can quickly run into those limits when every jar starts with c:\documents and settings\name\.m2\repository (or the equivalent on other platforms). Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven Enforcer: Banned dependencies including type, classifier etc.
Yes, it appears to support g:a:v only. I'm sure I had a reason at the time but I can't think of one now. It should be g:a:v:c:t On Thu, May 27, 2010 at 12:11 PM, Lewis, Eric eric.le...@ipi.ch wrote: Hi As far as I know, most Maven plugins rely on the Maven coordinates as described in http://maven.apache.org/pom.html#Maven_Coordinates I just tried to use them in the Maven Enforcer plugin's banned dependencies rule, but from reading the source, it looks like the Maven coordinates are only supported up to the version. Am I right with this? Should I write an enhancement request? Best regards, Eric - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org