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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to