Maven插件运行失灵

时间:2017-06-13 14:21:27

标签: maven maven-3

我有两个必须按顺序运行的插件,但无论我如何在pom.xml中指定它们,它们都以相反的顺序运行。这是POM片段,使用Maven 3.3.1:

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-ejb-plugin</artifactId>
   <version>2.5.1</version>
   <executions>
      <execution>
         <id>ejbcompile</id>
         <phase>compile</phase>
         <configuration>
            <ejbVersion>2.0</ejbVersion>
            <generateClient>true</generateClient>
            <clientIncludes>
               <clientInclude>com/myproject/**/interfaces/**</clientInclude>
               <clientInclude>*.ser</clientInclude>
            </clientIncludes>
            <ejbJar>META-INF/ejb-jar.xml</ejbJar>
         </configuration>
      </execution>
   </executions>
</plugin>
<plugin>
   <artifactId>maven-antrun-plugin</artifactId>
   <executions>
      <execution>
         <id>wsejbdeploy</id>
         <phase>compile</phase>
         <configuration>
            <tasks>
               <path id="was.classpath">
                  <fileset dir="${my.washome}/plugins">
                     <include name="com.ibm.ws.runtime.jar" />
                  </fileset>
               </path>    
               <taskdef name="wsEjbDeploy" 
                        classname="com.ibm.websphere.ant.tasks.WsEjbDeploy"  
                        classpathref="was.classpath" />
               <wsEjbDeploy inputJar="target/myproject-1.0.0-SNAPSHOT.jar"
                            outputJar="target/myproject-1.0.0-SNAPSHOT-DEPLOYED.jar"
                            wasHome="${my.washome}" />
            </tasks>
         </configuration>
         <goals>
            <goal>run</goal>
         </goals>
      </execution>
   </executions>
</plugin>

第二个插件取决于第一个插件的输出。我尝试了几种不同的方法,但是ant插件总是首先运行,即使它们都处于编译阶段并按照我想要的顺序声明。

谁能明白为什么?

0 个答案:

没有答案