2012-07-17 89 views

回答

2

歡迎來到Stack Overflow。

似乎沒有插件存在ASM,但據我所知,更好的解決方案是開發一個插件,做你想做的。開發插件非常簡單。

將它綁定到編譯階段,並確定。

如果你真的不想開發插件,你應該做這樣的事情:

<plugin> 
     <artifactId>maven-exec-plugin</artifactId> 
     <version>???</version> 
     <executions> 
      <execution> 
       <!-- The name you want, no really matter --> 
       <id>asm-compile</id> 
       <configuration> 
        ... 
       </configuration> 
       <!-- The phase you want to bind to --> 
       <phase>compile</phase> 
       <goals> 
        <goal>compile</goal> 
       </goals> 
      </execution> 
      <execution> 
+2

似乎'過程classes'是綁定到該階段。查看[maven生命週期參考](http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference)。 – FrVaBe 2012-07-18 14:48:10

+0

@FrVaBe你完全正確! – 2012-07-19 07:21:49

+0

'compile'和'package'之間有相當多的[階段](http://www.sonatype.com/books/mvnref-book/reference/lifecycle-sect-structure.html#lifecycle-sect-default) (創建jar文件的階段),你可以綁定maven-exec-plugin。包之前的最後階段是「準備包」。 – 2012-07-29 19:18:00

相關問題