diff --git a/.travis.yml b/.travis.yml index 4dd5d5a..8d1d949 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ deploy: provider: releases api_key: secure: WZKOSo3Zb3LO2R6gddhKL4YUFzKYSNv64OePXVBEkVU4b8Tic19gi0gcOCzUo0EORw9BVNzY69TkQKg4jSQJjEZ4AplrSJnzlwJ0LZwEjXKwJdkacbac7TRTIHNSLA+gqC86NhB5NJzWlEHEplYH8iB+QXoTLLpi8sqRY5JnGOo= - file: target/p3-spatialsearch-demo-$TRAVIS_TAG-jar-with-dependencies.jar + file: target/p3-spatialsearch-demo-$TRAVIS_TAG-standalone.jar on: repo: fusepoolP3/p3-spatialsearch-demo tags: true diff --git a/README.md b/README.md index 29a4b81..9630531 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Fusepool P3 Spatial Search Demo ============================ -A web application that uses the data sets from Fusepool P3 LDP to search for points of interest or events. +A LDP-enabled web application that uses the data sets from Fusepool P3 LDP to search for points of interest or events. [![Build Status](https://travis-ci.org/fusepoolP3/p3-spatialsearch-demo.svg?branch=master)](https://travis-ci.org/fusepoolP3/p3-spatialsearch-demo) diff --git a/pom.xml b/pom.xml index 493988f..5dbbedd 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 0.0.1-SNAPSHOT FusepoolP3 Spatial Search Demo p3-spatialsearch-demo - jar + war 1.7 @@ -113,6 +113,11 @@ + + + org.eclipse.jetty + jetty-maven-plugin + 9.3.0.M2 org.codehaus.mojo @@ -125,6 +130,18 @@ + + net.sf.alchim + winstone-maven-plugin + + + + embed + + package + + + diff --git a/src/main/java/eu/fusepool/p3/spatial/demo/Main.java b/src/main/java/eu/fusepool/p3/spatial/demo/Main.java index 45a226d..baad4f0 100644 --- a/src/main/java/eu/fusepool/p3/spatial/demo/Main.java +++ b/src/main/java/eu/fusepool/p3/spatial/demo/Main.java @@ -1,5 +1,9 @@ package eu.fusepool.p3.spatial.demo; +import java.io.File; +import java.net.URL; +import java.security.ProtectionDomain; + import org.eclipse.jetty.server.Server; import org.eclipse.jetty.webapp.WebAppContext; @@ -7,18 +11,23 @@ public class Main { public static void main(String[] args) throws Exception { - int port = 7100; - if (args != null) { + int port = 7302; + /* + if (args == null) { port = Integer.parseInt(args[0]); } - + */ + String webappDir = "src/main/webapp"; + ProtectionDomain domain = Main.class.getProtectionDomain(); + URL location = domain.getCodeSource().getLocation(); Server server = new Server(port); System.out.println("Running on port " + port); - WebAppContext webapp = new WebAppContext(); - webapp.setContextPath("/"); - //webapp.setAttribute("graph", graph); - webapp.setResourceBase("src/main/webapp"); - server.setHandler(webapp); + WebAppContext context = new WebAppContext(); + context.setWar(location.toExternalForm()); + context.setDescriptor(webappDir + "WEB-INF/web.xml"); + context.setContextPath("/"); + context.setResourceBase(webappDir); + server.setHandler(context); server.start(); server.join();