• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

LendingClub/gradle-maven-plugin: maven plugin to invoke gradle

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

LendingClub/gradle-maven-plugin

开源软件地址(OpenSource Url):

https://github.com/LendingClub/gradle-maven-plugin

开源编程语言(OpenSource Language):

Java 99.3%

开源软件介绍(OpenSource Introduction):

gradle-maven-plugin

Circle CI

This is a maven plugin that makes it easy to invoke Gradle tasks from within Maven.

Objective

Gradle is an awesome general-purpose tool. If your project/organization is committed to maven, switching to gradle may not be a practical option. The plugin is conceptually similar to the maven-antrun-plugin, which allows ant to be invoked from maven.

Now instead of using Ant to perform ad-hoc tasks from within Maven, you can use Groovy/Gradle instead!

Usage

The gradle-maven-plugin is now in Maven Central, so there is no need to declare a custom repository.

To use the plugin, simply declare the plugin and bind it to the maven lifecycle phase of your choice:

	<plugin>
		<groupId>org.fortasoft</groupId>
		<artifactId>gradle-maven-plugin</artifactId>
		<version>1.0.8</version>
		<configuration>
			<tasks>
				<!-- this would effectively call "gradle doSomething" -->
				<task>doSomething</task>
			</tasks>
		</configuration>
		<executions>
			<execution>
				<!-- You can bind this to any phase you like -->
				<phase>compile</phase>
				<goals>
					<!-- goal must be "invoke" -->
					<goal>invoke</goal>
				</goals>
			</execution>
		</executions>
	</plugin>

Now when you run maven, gradle will be invoked and execute the "doSomething" task defined in build.gradle.

Obviously you can change the task(s) to suit your needs.

In this example, the gradle invocation will happen during the maven "compile" phase, but this can be easily changed by changing the <phase> element value.

Options

These options can be given in the <configuration> element:

optionrequireddescriptionexample
taskyes (or tasks) gradle task to be invoked
<task>myTask</task>
tasksyes (or task) gradle tasks to be invoked
<tasks>
<task>task1</task>
<task>task2</task>
</tasks>
gradleVersionnoversion of gradle to use
<gradleVersion>1.6</gradleVersion>
gradleProjectDirectorynopath to the location of your build.gradle
<gradleProjectDirectory>
${project.basedir}/another/path
</gradleProjectDirectory>
javaHomenogive and explicit path to a JAVA_HOME
<javaHome> /my/path/to/jdk </javaHome>
argsnopass argument to gradle
<args>
<arg>-q</arg>
</args>
jvmArgsnopass JVM arg to gradle
<jvmArgs>
<jvmArg>-XX:MaxPermSize=128m</jvmArg>
<jvmArg>-Xmx256m</jvmArg>
</jvmArgs>

Plugin Testing

Here is some information on maven plugin testing. This project is currently using the maven-invoker-plugin for testing.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap