diff --git a/app.groovy b/app.groovy index dfd63db1..be7d820c 100644 --- a/app.groovy +++ b/app.groovy @@ -30,6 +30,7 @@ class MainController { model['styles'] = projects.styles.sort { it.name } model['types'] = projects.types.sort { it.name } model['packagings'] = projects.packagings.sort { it.name } + model['javaVersions'] = projects.javaVersions template 'home.html', model } @@ -178,6 +179,7 @@ class MainController { model.description = request.description model.packageName = request.packageName model.packaging = request.packaging + model.javaVersion = request.javaVersion if (style==null || style.size()==0) { style = [''] @@ -236,6 +238,7 @@ class PomRequest { String version = '0.0.1-SNAPSHOT' String packaging = 'jar' String packageName + String javaVersion = '1.7' String getArtifactId() { artifactId == null ? name : artifactId } @@ -250,6 +253,11 @@ class Projects { List> styles List types List packagings + List javaVersions + static class JavaVersion { + String value + boolean selected + } static class Packaging { String name String value diff --git a/application.yml b/application.yml index f18e0913..8edf6224 100644 --- a/application.yml +++ b/application.yml @@ -80,3 +80,10 @@ projects: - name: War value: war selected: false + javaVersions: + - value: 1.6 + selected: false + - value: 1.7 + selected: true + - value: 1.8 + selected: false diff --git a/templates/home.html b/templates/home.html index ef8fb87f..b9be9a71 100644 --- a/templates/home.html +++ b/templates/home.html @@ -58,6 +58,12 @@ ${it.name} <% } %> + + <% javaVersions.each { %> + <% } %> diff --git a/templates/starter-build.gradle b/templates/starter-build.gradle index 2f0092d8..7c525d0a 100644 --- a/templates/starter-build.gradle +++ b/templates/starter-build.gradle @@ -24,6 +24,8 @@ apply plugin: 'war' baseName = '${artifactId}' version = '${version}' } +sourceCompatibility = ${javaVersion} +targetCompatibility = ${javaVersion} repositories { mavenCentral()<% if (!bootVersion.contains("RELEASE")) { %> diff --git a/templates/starter-pom.xml b/templates/starter-pom.xml index 74d67063..49e3d9f7 100644 --- a/templates/starter-pom.xml +++ b/templates/starter-pom.xml @@ -33,7 +33,7 @@ UTF-8 ${packageName}.Application - 1.7 + ${javaVersion}