[maven] Use plugin and develop new plugin
2013-01-10 22:59
381 查看
Maven is a plugin execution platform. At its heart, all work is done by plugins.There are two kinds of plugins: build plugin and reporting plugin.Build plugin will be executed during the build and they should be configured in the <build> element from POM.Here
are the plugin list referred from maven office site: plugin list.In addtion, there are also useful plugins from third party like codehaus: maven
plugin list.
To use a plugin in maven, there are also two ways. One is using the plugin's goal in the command line directly, the other is binding the plugin's goal to life-cycle's phase.I will take Maven Exec Plugin for example to show how to use it in this recipe.
are the plugin list referred from maven office site: plugin list.In addtion, there are also useful plugins from third party like codehaus: maven
plugin list.
To use a plugin in maven, there are also two ways. One is using the plugin's goal in the command line directly, the other is binding the plugin's goal to life-cycle's phase.I will take Maven Exec Plugin for example to show how to use it in this recipe.
<project> ... <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.2.1</version> <executions> <execution> ... <goals> <goal>java</goal> </goals> </execution> </executions> <configuration> <mainClass>com.example.Main</mainClass> <arguments> <argument>argument1</argument> ... </arguments> <systemProperties> <systemProperty> <key>myproperty</key> <value>myvalue</value> </systemProperty> ... </systemProperties> </configuration> </plugin> </plugins> </build> ... </project>You can use <phase>clean</phase> inside of <execution> element to run com.example.Main class during clean life-cycle.There is an interesting plugin for Android: https://github.com/jayway/maven-android-plugin. You can use this plugin to build android project if you develop android projects.
相关文章推荐
- Use C# and the .NET Framework to develop your own plugin architecture
- Plugin is too old and ANDROID_DAILY_OVERRIDE value is also outdated, please use new value :"eac1b1d3
- It will cause a new session when you use lazy loading collection, and the collection will assicated with the new session and the
- maven plugin develop
- [EffectiveC++]item16:Use the same form in corresponding uses of new and delete
- NewSlot and ReuseSlot
- Scala-maven-plugin and Multiple Versions of Scala Libraries Detected
- Maven中的jeety插件运行报错:No plugin found for prefix 'jeety' in the current project and in the plugin group
- Flexible, organic and biodegradable: Stanford researchers develop new wave of electronics
- JavaWeb(6)-Maven Setup and Quick Use
- 使用IntelliJ IDEA, Maven and the jetty plugin调试web应用程序
- Maven: Maven Antrun Plugin configuration to copy package from target to basedir and rename it
- fail to execute goal org.eclipse.jetty:jetty-maven-plugin:jetty:run Address already in use
- A lot of Maven plugin comand
- Effective C++ Item 16 Use the same form in corresponding uses of new and delete
- How to use JUnit and Surefire in Maven
- jooq使用自定义策略生成代码(How to use a custom strategy with the jOOQ code-generator and Maven?)
- Maven Plugin And LifeCycle
- Knowing When to Use Override and New Keywords (C# Programming Guide)
- Class 'App\Http\Controllers\DB' not found and I also cannot use a new Model