GeoServer改造Springboot启动一(创建springboot)

GeoServer改造Springboot启动一(创建springboot)

GeoServer改造Springboot启动二(修改源码集成Swagger)

GeoServer改造Springboot启动三(集成jdbcconfig和jdbcstore)

GeoServer改造Springboot启动四(解决post接口方法无法用@requestbody为入参的请求)

GeoServer改造Springboot启动五(解决接口返回xml而不是json)

1、创建springboot模块

1.1将源码的src目录单独提取出来,更改名称为geoserver,如图 1。

图 1更改名称

1.2右键geoserver,选择New->Moudle..,出现如图 2,然后填写响应信息创建模块。

图 2创建springboot

1.3查看模块是否加入父级pom中。

图 3geoserver的pom.xml

2、加入注入配置文件

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

  1. 配置logback-spring.xml。
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值