读书人

[插件]应用Gradle打可执行jar包

发布时间: 2013-03-29 14:24:52 作者: rapoo

[插件]使用Gradle打可执行jar包

发现一个直接打出可执行jar包的gradle 插件

地址:

https://github.com/stigkj/gradle-executable-jar-plugin

?

用法:由于已经很明了,在此不做翻译了;

Executable Jar plugin for Gradle

The Executable Jar plugin creates an executable jar from your project with all its runtime dependencies embedded.

This means, when using this plugin in a build, you will get a?artifact_-execjar.jar?artifact than can be run like this:

java -jar artifact_name-execjar.jar
Usage

To use the executable jar plugin, include the following in your build script:

apply plugin: 'executable-jar'// This is the class that starts your applicationmainClass = 'the.class.that.has.Main'buildscript {    repositories {        mavenCentral()    }    dependencies {        classpath 'net.nisgits.gradle:gradle-executable-jar-plugin:master-REL-6'    }}

读书人网 >开源软件

热点推荐