You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by klimane <El...@fcc-fac.ca> on 2009/02/12 21:42:49 UTC
executing maven-exec-plugin twice doesn't seem to work
I am trying to get a maven-exec-plugin to run two different main programs in
a particular order within the same build. Here's what I've got in my pom:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>exec-1</id>
<goals>
<goal>java</goal>
</goals>
<phase>test-compile</phase>
<configuration>
<executable>java</executable>
<mainClass>ca.foo.CreateDatabase</mainClass>
<classpathScope>test</classpathScope>
</configuration>
</execution>
<execution>
<id>exec-2</id>
<goals>
<goal>java</goal>
</goals>
<phase>test-compile</phase>
<configuration>
<executable>java</executable>
<mainClass>ca.foo.CreateStaticData</mainClass>
<classpathScope>test</classpathScope>
</configuration>
</execution>
</executions>
</plugin>
What tends to happen is (if they execute in the correct order), exec-1 will
look like it executes, but it really doesn't because exec-2 fails at a part
that would have worked if exec-1 had run. Basically if you comment out
exec-2, then exec-1 runs properly, after which you can run exec-2. However
we need this to all work together within the same build.
So I have 2 questions:
1 - Can anyone help me out with why exec-1 doesn't seem to execute properly
if I try to also run exec-2? Do I just have the pom configured incorrectly?
2 - Is there a way to guarantee the order in which these are run?
--
View this message in context: http://www.nabble.com/executing-maven-exec-plugin-twice-doesn%27t-seem-to-work-tp21984581p21984581.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: executing maven-exec-plugin twice doesn't seem to work
Posted by klimane <El...@fcc-fac.ca>.
Yes, I had read that before. I guess I was hoping that something had changed
since then. For now it looks like we can bind the first one to an earlier
phase to guarantee the order.
Also, my other question has been resolved. The plugin was running properly
- there was some funny stuff happening that made me think that it was the
plugin causing the problem. However, it was my own mistake (an incorrect
variable specified in the pom) that was causing the problem.
Thanks for the info.
--
View this message in context: http://www.nabble.com/executing-maven-exec-plugin-twice-doesn%27t-seem-to-work-tp21984581p22006284.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: executing maven-exec-plugin twice doesn't seem to work
Posted by Trevor Harmon <tr...@vocaro.com>.
On Feb 12, 2009, at 3:42 PM, klimane wrote:
> I am trying to get a maven-exec-plugin to run two different main
> programs in
> a particular order within the same build.
Have you looked at this?
http://article.gmane.org/gmane.comp.java.maven-plugins.mojo.user/1307
Trevor
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org