I wrote a spring-boot application with gradle and it runs properly.
I build a fat jar using bootRepackage, I added the maven plugin so I can install the jars.
The problem is that I can't install the fat jar to the maven repository.
- "bootRepackage" builds that fat jar file
- install is dependent on the "jar" phase so it builds a thin jar overriding the fat jar file
- The thin jar is copied to the repository
Here's my gradle script for the base project, note that I'm still trying to install to my local repository (we're a new company and we're still building a remote repository)
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'
}
}
Gradle script for the module:
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'
}