diff --git a/app.groovy b/app.groovy index 3e871e83..f2c3032e 100644 --- a/app.groovy +++ b/app.groovy @@ -1,6 +1,6 @@ package app -@Grab("org.springframework.boot:spring-boot-starter-actuator:0.5.0.M1") +@Grab("org.springframework.boot:spring-boot-starter-actuator:0.5.0.BUILD-SNAPSHOT") @Grab("org.codehaus.groovy:groovy-ant:2.1.6") @Grab("org.codehaus.groovy.modules.http-builder:http-builder:0.5.2") @Grab(group='net.sf.json-lib', module='json-lib', version='2.3', classifier='jdk15') @@ -72,14 +72,15 @@ class MainController { log.info("Creating: " + download) tempFiles << download - reactor.notify("tempfiles", Event.wrap(tempFiles)) - new AntBuilder().zip(destfile: download) { zipfileset(dir:dir, includes:"**") } log.info("Downloading: " + download) - new ResponseEntity(download.bytes, ["Content-Type":"application/zip"] as HttpHeaders, HttpStatus.OK) + def result = new ResponseEntity(download.bytes, ["Content-Type":"application/zip"] as HttpHeaders, HttpStatus.OK) + reactor.notify("tempfiles", Event.wrap(tempFiles)) + + result } @RequestMapping("/pom") @@ -136,7 +137,7 @@ class TemporaryFileCleaner { @PostConstruct void init() { reactor.on(Selectors.$("tempfiles"), [ - accept: { + accept: { event -> def tempFiles = event.data log.info "Tempfiles: " + tempFiles if (tempFiles) { @@ -168,6 +169,6 @@ class PomRequest { artifactId == null ? name : artifactId } String getPackageName() { - packageName == null ? name : packageName + packageName == null ? name.replace('-', '.') : packageName } -} \ No newline at end of file +} diff --git a/manifest.yml b/manifest.yml index c7054702..f2c20c27 100644 --- a/manifest.yml +++ b/manifest.yml @@ -3,7 +3,8 @@ applications: - name: initializr memory: 1024M instances: 1 - url: initializr.cfapps.io + host: initializr + domain: cfapps.io path: . command: java -jar ./spring/lib/*.jar run --cp . --local app.groovy -- --server.port=$PORT # buildpack: https://github.com/dsyer/cloudfoundry-buildpack-java