2010-09-28 87 views
1

如何運行任務後maven eclipse:eclipse階段?特定階段後運行任務maven

<groupId>org.codehaus.mojo</groupId> 

<artifactId>exec-maven-plugin</artifactId> 

<version>1.2</version> 

<executions> 

    <execution> 

     <phase>eclipse:eclipse</phase> 

     <goals> 

      <goal>java</goal> 

     </goals> 

     <configuration> 

      <executable>java</executable> 

      <mainClass>a.b.c.Main</mainClass> 

     </configuration> 

    </execution> 

</executions> 

這個配置似乎也不行。

回答

2

如何運行一個任務post maven eclipse:eclipse階段?

您不能,eclipse:eclipse不是一個階段。

要麼在同一階段綁定一些目標(如果這甚至是有意義的),並且他們會按照他們的聲明順序執行。

或者從命令行調用它們(並且可選地提供從命令行運行時使用的默認配置)。例如,你可以這樣做:

<plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>exec-maven-plugin</artifactId> 
    <version>1.2</version> 
    <executions> 
    <execution> 
     <id>default-cli</phase> 
     <configuration> 
     <executable>java</executable> 
     <mainClass>a.b.c.Main</mainClass> 
     </configuration> 
    </execution> 
    </executions> 
</plugin> 

,然後調用:

mvn eclipse:eclipse exec:java