支持同时打war包和jar包
parent
375cd03575
commit
e46bf8a8bd
37
pom.xml
37
pom.xml
|
@ -14,6 +14,7 @@
|
||||||
<version>2.6.7</version>
|
<version>2.6.7</version>
|
||||||
<name>web video platform</name>
|
<name>web video platform</name>
|
||||||
<description>国标28181视频平台</description>
|
<description>国标28181视频平台</description>
|
||||||
|
<packaging>${project.packaging}</packaging>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
|
@ -56,6 +57,42 @@
|
||||||
<asciidoctor.pdf.output.directory>${project.build.directory}/asciidoc/pdf</asciidoctor.pdf.output.directory>
|
<asciidoctor.pdf.output.directory>${project.build.directory}/asciidoc/pdf</asciidoctor.pdf.output.directory>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>jar</id>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<project.packaging>jar</project.packaging>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>war</id>
|
||||||
|
<properties>
|
||||||
|
<project.packaging>war</project.packaging>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet</groupId>
|
||||||
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.genersoft.iot.vmp;
|
||||||
|
|
||||||
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||||
|
|
||||||
|
public class ServletInitializer extends SpringBootServletInitializer {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||||
|
return application.sources(VManageBootstrap.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.conf;
|
||||||
|
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
||||||
import com.genersoft.iot.vmp.service.IMediaServerService;
|
import com.genersoft.iot.vmp.service.IMediaServerService;
|
||||||
import org.apache.catalina.connector.ClientAbortException;
|
|
||||||
import org.apache.http.HttpHost;
|
import org.apache.http.HttpHost;
|
||||||
import org.apache.http.HttpRequest;
|
import org.apache.http.HttpRequest;
|
||||||
import org.apache.http.HttpResponse;
|
import org.apache.http.HttpResponse;
|
||||||
|
@ -15,11 +14,9 @@ import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.util.ObjectUtils;
|
import org.springframework.util.ObjectUtils;
|
||||||
import org.springframework.util.StringUtils;
|
|
||||||
|
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.ConnectException;
|
import java.net.ConnectException;
|
||||||
|
|
||||||
|
@ -77,9 +74,7 @@ public class ProxyServletConfig {
|
||||||
} catch (IOException ioException) {
|
} catch (IOException ioException) {
|
||||||
if (ioException instanceof ConnectException) {
|
if (ioException instanceof ConnectException) {
|
||||||
logger.error("zlm 连接失败");
|
logger.error("zlm 连接失败");
|
||||||
} else if (ioException instanceof ClientAbortException) {
|
} else {
|
||||||
logger.error("zlm: 用户已中断连接,代理终止");
|
|
||||||
} else {
|
|
||||||
logger.error("zlm 代理失败: ", e);
|
logger.error("zlm 代理失败: ", e);
|
||||||
}
|
}
|
||||||
} catch (RuntimeException exception){
|
} catch (RuntimeException exception){
|
||||||
|
@ -195,9 +190,7 @@ public class ProxyServletConfig {
|
||||||
} catch (IOException ioException) {
|
} catch (IOException ioException) {
|
||||||
if (ioException instanceof ConnectException) {
|
if (ioException instanceof ConnectException) {
|
||||||
logger.error("录像服务 连接失败");
|
logger.error("录像服务 连接失败");
|
||||||
} else if (ioException instanceof ClientAbortException) {
|
}else {
|
||||||
logger.error("录像服务:用户已中断连接,代理终止");
|
|
||||||
} else {
|
|
||||||
logger.error("录像服务 代理失败: ", e);
|
logger.error("录像服务 代理失败: ", e);
|
||||||
}
|
}
|
||||||
} catch (RuntimeException exception){
|
} catch (RuntimeException exception){
|
||||||
|
|
Loading…
Reference in New Issue