赞
踩
GeoServer改造Springboot启动一(创建springboot)
GeoServer改造Springboot启动二(修改源码集成Swagger)
GeoServer改造Springboot启动三(集成jdbcconfig和jdbcstore)
GeoServer改造Springboot启动四(解决post接口方法无法用@requestbody为入参的请求)
GeoServer改造Springboot启动五(解决接口返回xml而不是json)
1.1将源码的src目录单独提取出来,更改名称为geoserver,如图 1。
1.2右键geoserver,选择New->Moudle..,出现如图 2,然后填写响应信息创建模块。
1.3查看模块是否加入父级pom中。
图 3geoserver的pom.xml
2.1将以下10个 模块下的applicationContext.xml复制到resources目录下,并对应更改名称。
图 410个模块的配置文件
2.2主方法加入以下这10个配置文件。
图 5修改主方法
代码如下:
-
-
- package com.gs.springboot.gmserver;
-
- import org.springframework.boot.SpringApplication;
-
- import org.springframework.boot.autoconfigure.SpringBootApplication;
-
- import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
-
- import org.springframework.boot.web.servlet.ServletComponentScan;
-
- import org.springframework.context.annotation.ComponentScan;
-
- import org.springframework.context.annotation.ImportResource;
-
- import springfox.documentation.oas.annotations.EnableOpenApi;
-
-
-
- @SpringBootApplication(exclude = SecurityAutoConfiguration.class)
-
- @ServletComponentScan
-
- @ImportResource(
- locations={
- "classpath:applicationContext-kml.xml",
- "classpath:applicationSecurityContext.xml",
- "classpath:applicationContext-main.xml",
- "classpath:applicationContext-wms.xml",
- "classpath:applicationContext-wfs.xml",
- "classpath:applicationContext-wcs.xml",
- "classpath:applicationContext-wcs1.0.xml",
- "classpath:applicationContext-wcs2.0.xml",
- "classpath:applicationContext-gwc.xml",
- "classpath:applicationContext-jdbcstore.xml",
- "classpath:applicationContext-jdbcconfig.xml",
- "classpath:applicationContext-rest.xml",
- "classpath:applicationContext-restconfig.xml"
- }
- )
-
- @EnableOpenApi
-
- @ComponentScan(basePackages = {"org.geoserver.rest", "com.gs.springboot.gmserver"})
-
- public class GmserverApplication {
-
-
-
- public static void main(String[] args) {
-
- SpringApplication.run(GmserverApplication.class, args);
-
- }
-
-
-
- }
2.3配置application.properties。
图 6application.properties
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。