0
我用gradle編寫了一個spring-boot應用程序,它運行正常。使用gradle無法安裝spring-boot fat jar到Maven倉庫
我使用bootRepackage構建了一個胖罐子,我添加了maven插件以便可以安裝罐子。
問題是我無法將fat jar安裝到maven倉庫。
- 「bootRepackage」構建脂肪jar文件
- 安裝依賴於「罐子」相位因此它就建立一個薄罐重寫脂肪jar文件
- 薄罐被複制到存儲庫
這裏是我的基地項目gradle這個腳本,請注意,我仍然試圖將其安裝到我的本地庫(我們是一家新公司,我們仍在繼續遠程倉庫)
subprojects {
group 'myGroup'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'maven'
sourceCompatibility = 1.8
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'io.spring.gradle:dependency-management-plugin:0.5.6.RELEASE'
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.3.3.RELEASE'
classpath 'com.bmuschko:gradle-tomcat-plugin:2.0'
}
}
repositories {
jcenter()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
testCompile 'org.mockito:mockito-all:1.8.4'
compile 'ch.qos.logback:logback-classic:1.1.7'
}
task wrapper(type: Wrapper) {
gradleVersion = '2.12'
}
}
該模塊搖籃腳本:
apply plugin: "io.spring.dependency-management"
apply plugin: "spring-boot"
repositories {
jcenter()
}
dependencyManagement {
imports {
mavenBom 'io.spring.platform:platform-bom:2.0.3.RELEASE'
}
}
dependencies {
compile "org.springframework:spring-web"
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile 'com.netflix.feign:feign-okhttp:8.16.2'
}
謝謝,我會嘗試在週日 –
它的工作,但語法是有點不同:install.dependsOn { bootRepackage } –