fixed servlet dependencies

This commit is contained in:
Alexander Nozik 2017-04-11 22:48:41 +03:00
parent b5f1300c11
commit 804898ca93
2 changed files with 21 additions and 2 deletions

View File

@ -1,5 +1,21 @@
description = 'dataforge-server'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'io.ratpack:ratpack-gradle:1.4.5'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
}
}
apply plugin: "io.ratpack.ratpack-java"
apply plugin: 'com.github.johnrengelman.shadow'
mainClassName = "inr.numass.server.ServerRunner"
dependencies {
compile project(':numass-storage')
compile "hep.dataforge:storage-servlet" // project(':dataforge-storage:storage-servlet')
@ -20,3 +36,5 @@ task runServer(dependsOn: classes, type: JavaExec){
standardInput = System.in
standardOutput = System.out
}
ratpack.baseDir = file('ratpack')

View File

@ -28,6 +28,7 @@ import inr.numass.storage.NumassStorage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ratpack.handling.Chain;
import ratpack.server.BaseDir;
import ratpack.server.RatpackServer;
import ratpack.server.RatpackServerSpec;
import ratpack.server.ServerConfigBuilder;
@ -83,7 +84,7 @@ public class NumassServer extends AbstractNetworkListener {
ratpack = RatpackServer.start((RatpackServerSpec server) -> server
.serverConfig((ServerConfigBuilder config) -> config
// .baseDir(Paths.get(getClass().getResource("/ratpack/.ratpack").toURI()))
.findBaseDir()
.baseDir(BaseDir.find())
.address(InetAddress.getLocalHost())
.port(port))
.handlers((Chain chain) -> chain