From 11e80dd43b15b441f742eec7d9e657fab185b163 Mon Sep 17 00:00:00 2001 From: Andrew DeMaria Date: Fri, 24 Mar 2017 15:54:13 -0600 Subject: [PATCH] Jetty and Tomcat spring boot support Spring boot supports both Jetty and Tomcat, however only one is supposed to be used at a time. This is problematic for us, because we would like to have both on the classpath so we can configure them (i.e. org.libresonic.player.boot.TomcatApplication). To remedy this, we mark both as provided, but have two profiles which then tell spring to exclude one or the other from the lib-provided war. These exclude rules are a bit fragile, but can be reproduced by analyzing mvn dependency:tree output. Signed-off-by: Andrew DeMaria --- libresonic-main/pom.xml | 62 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 7 deletions(-) diff --git a/libresonic-main/pom.xml b/libresonic-main/pom.xml index 58ca10ee..d5ca6b6a 100644 --- a/libresonic-main/pom.xml +++ b/libresonic-main/pom.xml @@ -45,15 +45,17 @@ org.springframework.boot spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + - org.springframework.boot - spring-boot-starter-tomcat - provided - - - org.apache.tomcat.embed - tomcat-embed-jasper + javax.servlet.jsp + javax.servlet.jsp-api + 2.3.1 provided @@ -393,6 +395,31 @@ slf4j-api 1.7.24 + + + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + org.apache.tomcat.embed + tomcat-embed-jasper + provided + + + + org.springframework.boot + spring-boot-starter-jetty + provided + + + org.eclipse.jetty + apache-jsp + provided + + @@ -409,6 +436,8 @@ org.libresonic.player.boot.Application WAR + ${boot.group.excludes} + ${boot.artifact.excludes} @@ -467,4 +496,23 @@ + + + tomcat-embed + + true + + + org.eclipse.jetty,org.eclipse.jetty.websocket,org.mortbay.jasper,org.eclipse.jetty.toolchain,org.ow2.asm + spring-boot-starter-jetty + + + + jetty-embed + + org.apache.tomcat.embed + spring-boot-starter-tomcat + + +