Add temporary test jetty server (to be removed later).

master
Rémi Cocula 8 years ago
parent 3354f6623a
commit f6541632bb
  1. 28
      libresonic-main/pom.xml
  2. 20
      libresonic-main/src/main/java/org/libresonic/player/TestServer.java

@ -18,6 +18,34 @@
<dependencies>
<!-- Adding Jetty for a simple developement embedded server -->
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.5</version>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-embedded</artifactId>
<version>6.1.5</version>
<exclusions>
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-2.0</artifactId>
<version>6.1.5</version>
<type>pom</type>
</dependency>
<!-- END : Adding Jetty for a simple developement embedded server -->
<dependency>
<groupId>org.libresonic.player</groupId>
<artifactId>libresonic-rest-api</artifactId>

@ -0,0 +1,20 @@
package org.libresonic.player;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.webapp.WebAppContext;
public class TestServer {
public static void main(String[] args) throws Exception {
Server server = new Server(8080);
WebAppContext webapp = new WebAppContext();
webapp.setContextPath("/libresonic");
String baseDir = TestServer.class.getResource("/" + TestServer.class.getName().replaceAll("\\.", "/") + ".class").getFile();
baseDir = baseDir.substring(0,baseDir.indexOf("/target"));
webapp.setWar(baseDir + "/src/main/webapp");
server.setHandler(webapp);
server.setAttribute("reload", "automatic");
server.start();
server.join();
}
}
Loading…
Cancel
Save