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

danthegoodman/gradle-capsule-plugin: A Gradle plugin for Capsule, the packaging ...

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

开源软件名称(OpenSource Name):

danthegoodman/gradle-capsule-plugin

开源软件地址(OpenSource Url):

https://github.com/danthegoodman/gradle-capsule-plugin

开源编程语言(OpenSource Language):

Groovy 94.9%

开源软件介绍(OpenSource Introduction):

gradle-capsule-plugin

A Gradle plugin for Capsule, the packaging and deployment tool for JVM apps.

⚠️ This project is no longer maintained.

Consider using this gianluz's fork:

Currently using capsule v1.0.3.

Adding the Plugin

This plugin requires Gradle 2.4 and above. Simply define the plugins at the top of your build script:

plugins {
  id "us.kirchmeier.capsule" version "1.0.2"
}

Gradle 2.0 to 2.3 were last supported with plugin version 1.0.0.

Quick Start

This plugin defines no tasks, but instead provides several task types for building your own tasks.

FatCapsule

The FatCapsule type embedds your application and all of its dependencies into one executable jar file:

task fatCapsule(type: FatCapsule) {
  applicationClass 'com.foo.HelloWorld'
}

Use it like so:

$ gradle fatCapsule

$ cd build/libs
$ ls
project.jar project-capsule.jar

$ java -jar project-capsule.jar
Hello World!

Without further configuration:

  • It obtains your project source from the jar task.
  • It will include all of the dependencies from the runtime dependency configuration.
  • It will have the capsule classifier in it's file name.

MavenCapsule

The MavenCapsule type embeds only your application. It will download dependencies when the user executes the capulse.

Under the hood, it uses the maven capsule, which caches dependencies after downloading them.

task mavenCapsule(type: MavenCapsule){
  applicationClass 'com.foo.CoolCalculator'
}

Without further configuration:

  • It obtains your project source from the jar task.
  • It will download at runtime all of the dependencies from the runtime dependency configuration.
  • It will have the capsule classifier in it's file name.

Configuration

Capsule allows you define attributes in your capsule to onfigure system properties, pass in arguments to your application, limit compatible JVM versions and more. You may configure these using the capsuleManifest block.

See also: Capsule: Manifest Attributes and Source: CapsuleManifest

task myCapsule(type:FatCapsule){
  applicationClass 'com.foo.FancyCalculator'

  capsuleManifest {
    systemProperties['log4j.configuration'] = 'log4j.xml'
    args = ['--very-fancy']
    minJavaVersion = '1.8.0'
  }
}

Documentation

More thorough documentation is available in DOCUMENTATION.md.

Support

If you run into any issues or have an enhancement idea, please file an issue.

If you have any questions, capsule or gradle related, please start a topic on the Google Group/Mailing List.




鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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