gradle 打可执行jar包

来源:互联网 发布:广州新潮都网络批发城 编辑:程序博客网 时间:2024/04/30 19:52

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'    }}
0 0
原创粉丝点击