Gradle项目打包

本文章包含springboot项目以及普通项目打包

Springboot打包配置

plugins {
    id 'org.springframework.boot' version '2.3.2.RELEASE'
    id 'io.spring.dependency-management' version '1.0.9.RELEASE'
    id 'java'
}
//省略group version configurations repositories dependencies
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
tasks.withType(JavaCompile) {
    options.encoding = "UTF-8"
}
jar {
    manifest{
        attributes "Manifest-Version": 1.0,
        "Main-Class": '你的启动类'
    }
}
//省略test

打包执行 gradle clean jar即可

普通项目打包

plugins {
    id 'java'
    id 'com.github.johnrengelman.shadow' version '4.0.1'
}
//省略group version configurations repositories dependencies
apply plugin: 'idea'
apply plugin: 'java'
tasks.withType(JavaCompile) {
    options.encoding = "UTF-8"
}
jar {
    manifest{
        attributes "Manifest-Version": 1.0,
                "Main-Class": '你的启动类'
    }
}

打包执行 gradle clean shadowJar

暂无评论

发送评论 编辑评论


|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇