Use the Maven Wrapper in the Spring Data REST-based sample

Closes gh-146
This commit is contained in:
Andy Wilkinson
2015-10-06 16:41:34 +01:00
parent a693d12ce0
commit c97efcce2e
6 changed files with 386 additions and 5 deletions

View File

@@ -61,10 +61,7 @@ public class SampleBuildConfigurer {
mavenBuild.description = "Builds the ${name} sample with Maven"
mavenBuild.group = "Build"
mavenBuild.workingDir = this.workingDir
String suffix = File.separatorChar == '/' ? '' : '.bat'
mavenBuild.commandLine = [System.env.MAVEN_HOME ?
"${System.env.MAVEN_HOME}/bin/mvn${suffix}" : "mvn${suffix}",
'clean', 'package']
mavenBuild.commandLine = [isWindows() ? "mvnw.bat" : "./mvnw", 'clean', 'package']
mavenBuild.dependsOn dependencies
mavenBuild.doFirst {
@@ -76,6 +73,10 @@ public class SampleBuildConfigurer {
return mavenBuild
}
private boolean isWindows() {
return File.separatorChar == '\\'
}
private Task createGradleBuild(Project project, Object... dependencies) {
Task gradleBuild = project.tasks.create("${name}Gradle", GradleBuild)
gradleBuild.description = "Builds the ${name} sample with Gradle"