Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
enabled executable webapp
Browse files Browse the repository at this point in the history
  • Loading branch information
luigiselmi committed Mar 26, 2015
1 parent cde5625 commit 595c14d
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
19 changes: 18 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<version>0.0.1-SNAPSHOT</version>
<name>FusepoolP3 Spatial Search Demo</name>
<artifactId>p3-spatialsearch-demo</artifactId>
<packaging>jar</packaging>
<packaging>war</packaging>

<properties>
<java.version>1.7</java.version>
Expand Down Expand Up @@ -113,6 +113,11 @@
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.0.M2</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand All @@ -125,6 +130,18 @@
</arguments>
</configuration>
</plugin>
<plugin>
<groupId>net.sf.alchim</groupId>
<artifactId>winstone-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>embed</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
25 changes: 17 additions & 8 deletions src/main/java/eu/fusepool/p3/spatial/demo/Main.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
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;

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();

Expand Down

0 comments on commit 595c14d

Please sign in to comment.