GeoServer开发环境搭建

news/2024/10/11 2:28:19

前言

本文用于记录GeoServer开发环境的搭建过程

release

通过GeoServer发布计划可以看到,在2.23.x版本开始,会移除对jdk1.8的支持。那么当前我们会选择2.22.x版本进行研究

环境

  • JAVA:1.8或11
  • Maven
  • Git

Action

获取源码


git clone git://github.com/geoserver/geoserver.git geoserver# orgit clone https://github.com/geoserver/geoserver.git geoserver

代码库结构

Each branch has the following structure:

  • build - release and continuous integration scripts
  • doc - sources for the user and developer guides
  • src - java sources for GeoServer itself
  • data - a variety of GeoServer data directories / configurations

切换到2.22.x分支


# 查看分支
git branch -av# 切换分支
git checkout -b 2.22.x origin/2.22.x

002-002

002-003

Import modules into IntelliJ

  1. Run the IntelliJ IDE

  2. From the initial panel select Open.

002-004

  1. Navigate to the geoserver/src/pom.xml directory and click OK.

002-005

  1. When asked click on Open as a Project.

002-006

  1. Optionally, depending on which platform, IntelliJ may ask to Trust the Project.

002-007

  1. Wait for IntelliJ to Sync the dependencies, it’s possible to follow the process from the Build tab panel on the bottom.

002-008

Finalize the GeoServer Project configuration

  1. Click File > Project Structure.

002-009

  1. Update the Name and select the correct SDK accordingly to the GeoServer version.

002-010

  1. Click File > Settings.

002-011

  1. From Build, Execution, Deployment > Compiler > Annotation Processors, enable the Annotation processing.

002-012

  1. Click Build > Rebuild Project.

002-013

Run GeoServer from IntelliJ

  1. From the Project browser select the web-app module
  2. Navigate to the org.geoserver.web package
  3. Right-click the Start class and click to Modify Run Configuration...

如果没有该选项,那么直接去Edit Configurations处创建一个即可,Add Configuration,选择Application

002-014

  1. It is important to correctly set the Working directory to src/web/app. While having the Edit Configurations dialog open, fine tune the launch environment (including setting a GEOSERVER_DATA_DIR or the jetty.port). When settings are satisfactory, click OK.

002-015

002-016

  1. It’s possible now to run GeoServer by selecting Run -> Run 'Start'

002-017

第一次启动比较慢

002-018

Access GeoServer front page

  • After a few seconds, GeoServer should be accessible at: http://localhost:8080/geoserver
  • The default admin password is geoserver.

FAQ

依赖下载失败或过慢(该条仅供参考)

使用阿里云Maven镜像加速依赖下载,可以参考阿里云Maven向导进行设置【有代理应该就不需要了】

maven配置文件优先级,maven工具所在的conf配置 > 外部化配置

编译提示Node不存在(wcs1_1)

002-019

网络上有一些提示是:手动添加Node的依赖。但是我认为应该不需要手动设置才是,因为从官网的maven quick start中,并未使用任何的编辑器,直接命令行搞定。


# skip unit tests, skip spotless(Spotless is used as a fast way to check that the google-java-format is being applied to the codebase.)mvn clean install -DskipTests -Dspotless.apply.skip=true# 不想install, package也可以mvn clean package -DskipTests -Dspotless.apply.skip=true

这个时候可以看到,Node这个类存在于编译后的代码中

002-020

通过跟踪构建过程可以看到,是由javacc在编译过程中生成的(根据rangeset.jjt文件,知识盲区了)

002-021

其实在官方文档中已经提到了如何处理该问题的,参见Troubleshooting#1,就是需要先完成wcs1_1模块的编译构建。

我就不管那么多了,直接把所有的都构建了

Maven 使用

参见:GeoServer Maven Guide

参考

  • IntelliJ QuickStart

  • GeoServer Maven Guide

  • 阿里云云效Maven

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.ryyt.cn/news/27424.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈,一经查实,立即删除!

相关文章

拂衣天气(微天气)Github Action镜像自动构建与推送

前言 这里暂不作过多的操作,还是保持与此前一致。即通过Github Action完成Docker Image的build与push,目标仓库为阿里云容器镜像服务实例(个人版)registry.cn-hangzhou.aliyuncs.com 那么一共分为三个部分:Dockerfile编写 阿里云容器镜像服务配置 Github ActionDockerfile…

拂衣天气(微天气)终篇

起源 天气小程序产生于2022年年初,目的是用于验证自己是否有进入全栈开发(仅前后端)的能力。 受新冠疫情影响,2022年的春节是在杭州过的。还记得当时附近好几个地方都被划为了高风险,对整个区进行了管控。如果选择回家的话,得到将是14天的隔离,还不确定能否回来上班。因…

拂衣天气(微天气)-技术预研

前言 俗话说:磨刀不误砍柴工。 我想做一个天气类别的小程序,以此进行全栈开发能力的试炼。我想这会是一个微信小程序、是一个可以正常使用的小程序,以Java进行服务端开发,以Mapbox实现天气数据可视化。 但是我是一个后端开发工程师,我不怎么会写页面,我特别的讨厌写CSS。…

跟羽夏去实现协程

跟羽夏来自己亲自去实现一个简单的协程,并让它运行起来。写在前面此系列是本人一个字一个字码出来的,包括示例和实验截图。本人非计算机专业,可能对本教程涉及的事物没有了解的足够深入,如有错误,欢迎批评指正。 如有好的建议,欢迎反馈。码字不易,如果本篇文章有帮助你的…

VScode自定义折叠代码快 region和endregion 关键字

前言全局说明VScode自定义折叠代码快 region和endregion 关键字一、说明vscode 有自带的代码折叠功能,但是因为某些内容不是标准的代码或不被识别就不能正常被折叠 比如很多的单行注释,或者被注释的代码就能不能自动折叠。 这里就要用到 region和endregion 关键字使用时 regi…

推荐系统工程架构

推荐系统简介 计算原理 我们把每个用户/视频表示成空间中的一个点。 如果两个点越接近,就认为这个用户对这个视频的喜欢程度越高,反之越低。 用户点赞这个视频就拉近两点,没点赞就拉远两点的距离。这样就组成了整体推荐系统推荐系统流程 从海量视频中召回用户感兴趣的视频,…

一键自动化博客发布工具,chrome和firfox详细配置

blog-auto-publishing-tools博客自动发布工具现在已经可以同时支持chrome和firefox了.blog-auto-publishing-tools博客自动发布工具现在已经可以同时支持chrome和firefox了。 很多小伙伴可能对于如何进行配置和启动不是很了解,今天带给大家一个详细的保姆教程,只需要跟着我的…

统一场理论公式推导和笔记——part5

三十七,运动电荷的磁场产生引力场 1,匀速直线运动电荷的磁场产生引力场 统一场论核心是变化的引力场可以产生电场,反过来,变化的电磁场也可以产生引力场。==》根据爱因斯坦的广义相对论,变化的电磁场确实可以产生引力场,尽管理论上变化电磁场会产生引力场,但由于电磁场的能…