Re: Maven and Ant Integration (Ignores Ant version)
Petr, If it makes any difference, I have Maven 2.0.7 and the antrun plugin with Junit combination works for me. I am, however, using the 3.8.1 version of Junit, but i don't think it matters. Maven-antrun-plugin page also has a writeup on how to use optional tasks: http://maven.apache.org/plugins/maven-antrun-plugin/classpaths.html I have the following in my plugin: plugin artifactIdmaven-antrun-plugin/artifactId inheritedfalse/inherited executions execution idrun-integration-tests/id phaseintegration-test/phase goals goalrun/goal /goals configuration tasks junit printsummary=withOutAndErr showoutput=yes haltonfailure=true fork=true timeout=18 classpath refid=maven.test.classpath/ formatter type=plain/ test name=org.marketcetera.SomeTest todir=${project.build.directory}/surefire-reports/ /junit /tasks /configuration /execution /executions dependencies dependency groupIdant/groupId artifactIdant-junit/artifactId version1.6.5/version /dependency dependency groupIdjunit/groupId artifactIdjunit/artifactId version3.8.1/version /dependency /dependencies /plugin hope this helps. -- Toli Kuznets http://www.marketcetera.com: Open-Source Trading Platform download.run.trade. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Maven and Ant Integration (Ignores Ant version)
remove foot from mouth Appears that I spoke too soon - i can indeed run the maven/ant/junit combo from inside a sub-modules but it doesn't work for me in the top-level package with child modules. oh well. any other suggestions on how to workaround this problem until the aforementioned bug is fixed? On 7/11/07, Toli Kuznets [EMAIL PROTECTED] wrote: Petr, If it makes any difference, I have Maven 2.0.7 and the antrun plugin with Junit combination works for me. I am, however, using the 3.8.1 version of Junit, but i don't think it matters. Maven-antrun-plugin page also has a writeup on how to use optional tasks: http://maven.apache.org/plugins/maven-antrun-plugin/classpaths.html -- Toli Kuznets http://www.marketcetera.com: Open-Source Trading Platform download.run.trade. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to execute a system command from maven 2?
Jerome, I'm seeing the same missing executable argument problem. I'm using exec-maven-plugin 1.1-beta-1 My maven POM section is below. I'm pretty sure i have the groupId/artifactID correct. Also, is there any way to fork (ie run the executed command in the background) aside from putting a in the shell script itself? Specifying -Dexec.executable=runExchange.sh does work, but i can't get it to work from inside maven POM itself. thanks! POM: plugin groupIdorg.codehaus.mojo/groupId artifactIdexec-maven-plugin/artifactId configuration executablerunExchange.sh/executable /configuration executions execution idstart-exchange/id phasepre-integration-test/phase goals goalexec/goal /goals /execution /executions /plugin Error: [INFO] One or more required plugin parameters are invalid/missing for 'exec:exec' [0] inside the definition for plugin: 'exec-maven-plugin'specify the following: configuration executableVALUE/executable /configuration -OR- on the command line, specify: '-Dexec.executable=VALUE' -- Toli Kuznets http://www.marketcetera.com: Open-Source Trading Platform download.run.trade. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: POM variable reference?
Bram, This may be helpful: 1. Reference for the POM: http://maven.apache.org/ref/current/maven-model/maven.html If you scroll past the .xsd file, you'll see the description of all XML elements. 2. for each variable, you can usually access it using ${project.varname} so maybe you can get to ${project.basedir} to get your root basedir, for example. hope this helps. On 7/27/06, Bram de Kruijff [EMAIL PROTECTED] wrote: Hi, can anyone direct me to a reference/tutorial on build-in parameters? I'm hoping to find out how I can reference the root basedir of a multiproject build. Didn't find it on the Maven site, Google or the Better builds.. book :( regards, Bram -- Bram de Kruijff GX creative online development B.V. t: 024 - 3888 261 f: 024 - 3888 621 e: [EMAIL PROTECTED] Wijchenseweg 111 6538 SW Nijmegen http://www.gx.nl/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Toli Kuznets http://www.marketcetera.com: Open-Source Trading Platform download.run.trade. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [maven-antrun-plugin] How to pass default Maven Properties to ant/ ?
Alexis, i've experimented with this as well and ended up with the same solution as you. I'm afraid that may be the only option for now. On 7/27/06, Alexis Midon [EMAIL PROTECTED] wrote: Hi all, As recommended by the antrun pluginhttp://maven.apache.org/plugins/maven-antrun-plugin/introduction.html, I'd like to move all my Ant tasks to a build.xml file and just call it from the POM using Ant's ant/ taskhttp://ant.apache.org/manual/CoreTasks/ant.html . I need to use some of the Maven properties (${project.build.directory}, ${ project.build.outputDirectory}, etc.) inside the build.xml, unfortunately it seems that those properties are not inherited from the Maven Project. To be precise, Maven properties are available in the Maven tasks tag but not passed to the ant task. configuration tasks !-- Maven properties are available inside the tasks... -- echo${project.build.directory}/echo !-- but not in the build.xml file! -- ant dir=${basedir} antfile=build.xml / /tasks /configuration The only workaround I found out is to explicitly declare the properties before or inside the ant tag. But you will agree that this not really neat nor efficient. configuration tasks !-- Pass all the properties that may be needed in the ant file -- property name=project.build.directory value=${ project.build.directory}/ ant dir=${basedir} antfile=build-test.xml / /tasks /configuration Does anyone have a solution please? Thanks in advance for your help, Alexis -- Toli Kuznets http://www.marketcetera.com: Open-Source Trading Platform download.run.trade. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [M2] Ant Mojo
Hilco, I think we did something similar to what you are trying to do: i had an an ant target that run a junit task, which is an optional task as well. I got that to work by adding a dependency on ant-junit in my POM file, and calling out to the junit task within the same POM: dependency groupIdant/groupId artifactIdant-junit/artifactId version1.6.5/version scopetest/scope /dependency /dependencies build plugins plugin artifactIdmaven-antrun-plugin/artifactId executions execution idrun-integration-tests/id phaseintegration-test/phase configuration tasks property name=integrationTestReportDir value=${project.build.directory}/integration-test-reports/ taskdef name=junit classname=org.apache.tools.ant.taskdefs.optional.junit.JUnitTask classpath path refid=maven.test.classpath/ /classpath /taskdef mkdir dir=${integrationTestReportDir}/ junit printSummary=yes haltonerror=true haltonfailure=true fork=true dir=. sysproperty key=basedir value=./ formatter type=plain usefile=true/ classpath path refid=maven.test.classpath/ /classpath batchtest todir=${integrationTestReportDir} fileset dir=src/test/java include name=**/*IT.java/ /fileset /batchtest /junit /tasks /configuration goals goalrun/goal /goals /execution /executions /plugin ... hope this helps. you can find the entire source of the POM at http://svn.marketcetera.org/platform/trunk/oms/pom.xml On 7/21/06, Hilco Wijbenga [EMAIL PROTECTED] wrote: Hi all, I followed the Developing Ant Plugins for Maven2.x guide and ended up with a nicely working hello-plugin. I would like to try more daring things now. :-) Instead of echoHello world/echo I'd like to execute echoproperties/. This is part of the optional Ant tasks, however. How do I include those? The real object is to run XJC's Ant task. I know there are JAXB Maven2 plugins available but I'd like to know how to build a plugin myself. It's working in Ant. Now I need to get it to run in Maven2. The problem is creating the classpath for the XJC task. In my Ant build.xml I have taskdef name=xjc classname=com.sun.tools.xjc.XJCTask classpath fileset dir=lib includes=*.jar/ /classpath /taskdef but that doesn't work in Maven2, of course. I can include the various jars as dependencies (in the pom.xml for the plugin, I assume) but how do I access them in xjc.build.xml? I guess I could use something like ${user.home}/.m2/repository/... but that doesn't strike me as the right way to go about things. Please enlighten me. Cheers, Hilco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Toli Kuznets http://www.marketcetera.org: Open-Source Trading Platform download.run.trade. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Launch application through maven 2.x
Fred, I've had some limited success with the exec-maven plugin. If you only need to launch a java app with maven and can specify all configs in your pom, then it works great. However, if you thought that you could specify some args on command line (such as -Dexec.args) then there are some bugs with parsing and assignment of command-line args. http://jira.codehaus.org/browse/MEXEC-5 nevertheless, it works great, and here's an example of launching your own app from within Maven. Place this in the plugins section in the builds in your POM: plugin groupIdorg.codehaus.mojo/groupId artifactIdexec-maven-plugin/artifactId configuration mainClassorg.marketcetera.oms.OrderManagementSystem/mainClass arguments argumentoms/argument /arguments systemProperties systemProperty keyfoo/key !-- plugin crashes when there are no values here -- valuebar/value /systemProperty /systemProperties /configuration /plugin On 7/14/06, Andrius Ĺ abanas [EMAIL PROTECTED] wrote: Fred wrote: Hi, Is it possible to launch an application with maven 2.x ? I mean is there any goal that allows users to launch an application with mvn command line ? (ex. mvn run runs the main class of the project). If not, does it exist a way to do it (with some plugin or whatever) ? Thanks for your support, Fred. Hello, Try exec-maven-plugin, hosted at Codehaus Mojo project. See http://mojo.codehaus.org/exec-maven-plugin/. cheers, Andrius - 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: How to specify what's included in the jar with maven-jar-plugin?
Sebastien, you can explicitly configure the maven-jar plugin to jar your test code. We do it this way: plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-jar-plugin/artifactId executions execution idbundle-test-jar/id phasepackage/phase goals goaltest-jar/goal /goals /execution /executions /plugin it gets bound to the package phase so it's created during 'mvn package'. It appends the -tests suffix to the jar, so that later, if you need to refer to it (to copy it somewhere, for example or to declare a dependency) you need to use the test classifier so that maven would know to append the -tests suffix: dependency groupIdorg.marketcetera/groupId artifactIdcore/artifactId version${project.version}/version classifiertests/classifier scopetest/scope /dependency hope this helps. -- Toli Kuznets Marketcetera.org: Open-Source Trading Platform: download.run.trade. On 7/14/06, Sebastien Pennec [EMAIL PROTECTED] wrote: Hello, I am trying to build a multi-module project. One module (core) is needed by another module. When I run mvn install, a jar with the core module is built, but it doesn't contain the test classes, and I need them to be included. I've search through the maven-jar-plugin site but nothing seems to do the trick. I've already used a few assemblies and I guess I could use this to build the jar I need, but then, the install command wouldn't use it automatically (right?). Anybody knows how to specify what's supposed to be included in the jar? Or is there another way to include my test classes in the jar? Thanks a lot, Sebastien -- Sebastien Pennec [EMAIL PROTECTED] LOGBack: the generic, reliable, fast and flexible logging library for Java. - 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]
Is it possible to setup plugin to execute only in the parent POM and not descend into sub-modules?
Hi, This may be a dumb question resulting from my mis-understanding of Maven. Pardon me, i'm new. Anyway, i have an ant task i want to exec from CLI. My project has 4 sub-modules in it. I want to setup an installer that does this: 1. use assembly to copy all dependencies and jars to one library 2. generate custom run shell scripts that will start my apps 3. package it all together into a tarball for distribution. I know i can use assembly plugin to do #1 and #3, but i didn't want to create static hardcoded run files in case the versions change. So i created an ant task to call out to a shell script to generate some files. However, when i call the antrun:run plugin, it runs not only in parent space but also tries to run it for each child module. Is there a way to disable that? How do i setup a goal to be only run from CLI for the parent module and not descend into any children? thanks ps: if anybody has a better idea of how to package installers while generating custom run scripts (w/out creating my own plugin that does that) please let me know. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is it possible to setup plugin to execute only in the parent POM and not descend into sub-modules?
Kris, This is exaclty what i was looking for. Can't believe i never found the entire .xsd for the pom file before! Thanks! On 7/13/06, Bravo, Kris [EMAIL PROTECTED] wrote: This may work for you: http://maven.apache.org/ref/current/maven-model/maven.html#class_plugin Set inherited to false and give it another try. kris bravo * Clarify Development * office: 678.893.1288 * mobile: 678.296.8723 -Original Message- From: Toli Kuznets [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 1:23 PM To: users@maven.apache.org Subject: Is it possible to setup plugin to execute only in the parent POM and not descend into sub-modules? Hi, This may be a dumb question resulting from my mis-understanding of Maven. Pardon me, i'm new. Anyway, i have an ant task i want to exec from CLI. My project has 4 sub-modules in it. I want to setup an installer that does this: 1. use assembly to copy all dependencies and jars to one library 2. generate custom run shell scripts that will start my apps 3. package it all together into a tarball for distribution. I know i can use assembly plugin to do #1 and #3, but i didn't want to create static hardcoded run files in case the versions change. So i created an ant task to call out to a shell script to generate some files. However, when i call the antrun:run plugin, it runs not only in parent space but also tries to run it for each child module. Is there a way to disable that? How do i setup a goal to be only run from CLI for the parent module and not descend into any children? thanks ps: if anybody has a better idea of how to package installers while generating custom run scripts (w/out creating my own plugin that does that) please let me know. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]