diff --git a/numass-storage/numass-server/build.gradle b/numass-storage/numass-server/build.gradle index 10e319ef..7fc3c30a 100644 --- a/numass-storage/numass-server/build.gradle +++ b/numass-storage/numass-server/build.gradle @@ -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') @@ -19,4 +35,6 @@ task runServer(dependsOn: classes, type: JavaExec){ workingDir "D:\\Temp\\test\\" standardInput = System.in standardOutput = System.out -} \ No newline at end of file +} + +ratpack.baseDir = file('ratpack') \ No newline at end of file diff --git a/numass-storage/numass-server/src/main/java/inr/numass/server/NumassServer.java b/numass-storage/numass-server/src/main/java/inr/numass/server/NumassServer.java index d0609c8c..33f30e38 100644 --- a/numass-storage/numass-server/src/main/java/inr/numass/server/NumassServer.java +++ b/numass-storage/numass-server/src/main/java/inr/numass/server/NumassServer.java @@ -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