From 674b66fd2b047e9f8d67fbab1ecd3f02b7a92c73 Mon Sep 17 00:00:00 2001 From: John McClean Date: Tue, 9 Jun 2015 16:37:07 +0100 Subject: [PATCH] make releasing simpler --- build.gradle | 4 +++- gradle.properties | 1 + micro-boot/build.gradle | 2 +- micro-core/build.gradle | 2 +- .../simple/com/aol/micro/server/SimpleApp.java | 6 ++++++ .../com/aol/micro/server/SimpleRunnerTest.java | 11 +++++++++-- .../aol/micro/server/SimpleStatusResource.java | 18 +++++++++++++++++- settings.gradle | 2 +- 8 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 gradle.properties diff --git a/build.gradle b/build.gradle index 204a9703e..f29a66cd6 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,6 @@ subprojects { apply plugin: 'com.bmuschko.nexus' sourceCompatibility = 1.8 targetCompatibility = 1.8 - version = '0.56' jar { manifest { @@ -103,6 +102,9 @@ subprojects { compile group: 'org.glassfish.grizzly', name: 'grizzly-http-all', version:"$grizzlyVersion" compile group: 'org.glassfish.jersey.containers', name: 'jersey-container-grizzly2-http', version:"$jerseyVersion" compile group: 'org.glassfish.jersey.containers', name: 'jersey-container-grizzly2-servlet', version:"$jerseyVersion" + compile 'org.glassfish.jersey.media:jersey-media-multipart:2.17' + + // compile 'org.glassfish.jersey:jax-rs-ri:2.0-rc1' compile "org.glassfish.jersey.ext:jersey-spring3:$jerseyVersion" compile "org.glassfish.jersey.ext:jersey-bean-validation:$jerseyVersion" // testCompile ('org.springframework:spring-jdbc-roma:1.0.0-RELEASE'){ diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 000000000..7747d0ba9 --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +version=0.57 diff --git a/micro-boot/build.gradle b/micro-boot/build.gradle index 0348dcc8b..6b64d24e8 100644 --- a/micro-boot/build.gradle +++ b/micro-boot/build.gradle @@ -19,7 +19,7 @@ modifyPom { groupId 'com.aol.microservices' artifactId 'microserver-boot' - version '0.56' + version "$version" scm { url 'scm:git@github.com:aol/micro-server.git' diff --git a/micro-core/build.gradle b/micro-core/build.gradle index 41c97a7b7..336aabdb1 100644 --- a/micro-core/build.gradle +++ b/micro-core/build.gradle @@ -12,7 +12,7 @@ modifyPom { groupId 'com.aol.microservices' artifactId 'microserver-core' - version '0.57' + version "$version" dependencyManagement { dependencies{ diff --git a/micro-core/src/test/java/app/simple/com/aol/micro/server/SimpleApp.java b/micro-core/src/test/java/app/simple/com/aol/micro/server/SimpleApp.java index 0314f5d27..700a2c778 100644 --- a/micro-core/src/test/java/app/simple/com/aol/micro/server/SimpleApp.java +++ b/micro-core/src/test/java/app/simple/com/aol/micro/server/SimpleApp.java @@ -1,10 +1,16 @@ package app.simple.com.aol.micro.server; +import java.util.Arrays; + +import org.glassfish.jersey.media.multipart.MultiPartFeature; + import com.aol.micro.server.MicroserverApp; +import com.aol.micro.server.module.ConfigurableModule; public class SimpleApp { public static void main(String[] args){ + new MicroserverApp(()-> "simple-app").run(); } diff --git a/micro-core/src/test/java/app/simple/com/aol/micro/server/SimpleRunnerTest.java b/micro-core/src/test/java/app/simple/com/aol/micro/server/SimpleRunnerTest.java index 753bc65c1..6249ef506 100644 --- a/micro-core/src/test/java/app/simple/com/aol/micro/server/SimpleRunnerTest.java +++ b/micro-core/src/test/java/app/simple/com/aol/micro/server/SimpleRunnerTest.java @@ -4,14 +4,17 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; +import java.util.Arrays; import java.util.concurrent.ExecutionException; +import org.glassfish.jersey.media.multipart.MultiPartFeature; import org.junit.After; import org.junit.Before; import org.junit.Test; import com.aol.micro.server.MicroserverApp; import com.aol.micro.server.config.Microserver; +import com.aol.micro.server.module.ConfigurableModule; import com.aol.micro.server.testing.RestAgent; @Microserver @@ -22,8 +25,12 @@ public class SimpleRunnerTest { MicroserverApp server; @Before public void startServer(){ - - server = new MicroserverApp(()-> "simple-app"); + server = new MicroserverApp(ConfigurableModule + .builder() + .context("simple-app") + .defaultResources(Arrays.asList(MultiPartFeature.class)) + .build()); + // server = new MicroserverApp(()-> "simple-app"); server.start(); } diff --git a/micro-core/src/test/java/app/simple/com/aol/micro/server/SimpleStatusResource.java b/micro-core/src/test/java/app/simple/com/aol/micro/server/SimpleStatusResource.java index b06373a52..07b6a5610 100644 --- a/micro-core/src/test/java/app/simple/com/aol/micro/server/SimpleStatusResource.java +++ b/micro-core/src/test/java/app/simple/com/aol/micro/server/SimpleStatusResource.java @@ -1,8 +1,16 @@ package app.simple.com.aol.micro.server; +import java.io.InputStream; + +import javax.ws.rs.Consumes; import javax.ws.rs.GET; +import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.FormDataParam; import com.aol.micro.server.auto.discovery.Rest; @@ -20,5 +28,13 @@ public String ping() { return "ok"; } - + @POST + @Consumes(MediaType.MULTIPART_FORM_DATA) + @Produces(MediaType.TEXT_PLAIN) + @Path("/file") + public String create(@FormDataParam("file") InputStream fileInputStream, + @FormDataParam("file") FormDataContentDisposition contentDispositionHeader) { + + return "done"; + } } \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 345056464..ab970785e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,4 @@ -rootProject.name = 'micro-server' +rootProject.name = 'com.aol.microservices.micro-server' include ':micro-core' include ':micro-boot' include ':micro-tutorial'