Verify that bootJar and bootWar handle duplicates gracefully

Closes gh-9573
This commit is contained in:
Andy Wilkinson 2017-06-22 07:46:30 -07:00
parent f0b7e7cf56
commit c59214792b
2 changed files with 37 additions and 0 deletions

View File

@ -115,4 +115,10 @@ public abstract class AbstractBootArchiveIntegrationTests {
}
@Test
public void duplicatesAreHandledGracefully() throws IOException {
assertThat(this.gradleBuild.build(this.taskName).task(":" + this.taskName)
.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
}
}

View File

@ -0,0 +1,31 @@
buildscript {
dependencies {
classpath files(pluginClasspath.split(','))
}
}
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
bootJar {
mainClass = 'com.example.CustomMain'
duplicatesStrategy = "exclude"
}
configurations {
provided
}
sourceSets.all {
compileClasspath += configurations.provided
runtimeClasspath += configurations.provided
}
repositories {
maven { url "https://repo.spring.io/libs-snapshot" }
}
dependencies {
compile "org.apache.commons:commons-lang3:3.6"
provided "org.apache.commons:commons-lang3:3.6"
}