eclipse中建geoserver源码

概述:本文讲述的是在eclipse中如何构建geoserver源码工程,其中涉及到了jdk,github,marven等。

1、安装git

从(http://git-scm.com/download/win),获得Git-1.9.0-preview2014021 7.exe文件,直接安装即可。安装成功后,在任何处所右击鼠标,出现如下图所示:

百度网盘下载

2、从git中签出geoserver源码

点击“Git GUI”将呈现如下界面,选择“克隆已有版本”,进入源码克隆界面,输入响应的source Location(源码地点地位git://github.com/geoserver/geoserver.git) 和 Target Location(本地存储地位)。

克隆已有版本

输入参数

克隆完成后,源代码的组织如下:

3、下载并配置Maven

(http://maven.apache.org/download.cgi)选择apache-maven-3.21-bin.zip,maven是号令行法度,将获得的紧缩包解压,解压后文件组织如下:

并添加D:\software\java\web\maven\bin到path变量中。

maven百度网盘下载地址

4、通过maven构建源码

4.1  跳转路径到geoserver的src目录下

C:\Users\Administrator>d:
D:\>cd D:\opengis\opengis\src
D:\opengis\opengis\src>

4.2 临时将maven的路径添加至环境变量中

执行如下命令:

Set PATH = “maven_dir/bin”;%PATH%

4.3 构建工程

执行如下命令,构建工程:

mvn clean install
mvn -DskipTests clean install

注意:第一条号令在构建的同时履行测试用例测试类文件,在号令履行过程中有可能会呈现错误;第二条号令在构建时,不进行测试,不会有测试不经由过程的异常。

执行命令输出:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] GeoServer ......................................... SUCCESS [  5.916 s]
[INFO] Core Platform Module .............................. SUCCESS [  5.763 s]
[INFO] Open Web Service Module ........................... SUCCESS [  6.644 s]
[INFO] Main Module ....................................... SUCCESS [01:15 min]
[INFO] GeoServer Security Modules ........................ SUCCESS [  0.607 s]
[INFO] GeoServer JDBC Security Module .................... SUCCESS [  8.048 s]
[INFO] GeoServer LDAP Security Module .................... SUCCESS [  8.002 s]
[INFO] Web Coverage Service Module ....................... SUCCESS [  3.605 s]
[INFO] Web Coverage Service 1.0 Module ................... SUCCESS [  6.524 s]
[INFO] Web Coverage Service 1.1 Module ................... SUCCESS [ 10.715 s]
[INFO] Web Coverage Service 2.0 Module ................... SUCCESS [ 13.674 s]
[INFO] Web Feature Service Module ........................ SUCCESS [ 18.692 s]
[INFO] Web Map Service Module ............................ SUCCESS [03:41 min]
[INFO] KML support for GeoServer ......................... SUCCESS [01:17 min]
[INFO] GeoWebCache (GWC) Module .......................... SUCCESS [03:34 min]
[INFO] REST Support Module ............................... SUCCESS [  3.981 s]
[INFO] REST Configuration Service Module ................. SUCCESS [01:23 min]
[INFO] GeoServer Web Modules ............................. SUCCESS [  0.162 s]
[INFO] Core UI Module .................................... SUCCESS [02:46 min]
[INFO] WMS UI Module ..................................... SUCCESS [  5.256 s]
[INFO] GWC UI Module ..................................... SUCCESS [ 10.776 s]
[INFO] WFS UI Module ..................................... SUCCESS [  3.262 s]
[INFO] Demoes Module ..................................... SUCCESS [01:08 min]
[INFO] WCS UI Module ..................................... SUCCESS [  4.632 s]
[INFO] Security UI Modules ............................... SUCCESS [  0.155 s]
[INFO] Security UI Core Module ........................... SUCCESS [  7.840 s]
[INFO] Security UI JDBC Module ........................... SUCCESS [  4.315 s]
[INFO] Security UI LDAP Module ........................... SUCCESS [ 12.600 s]
[INFO] GeoServer Web Application ......................... SUCCESS [01:42 min]
[INFO] Community Space ................................... SUCCESS [  7.778 s]
[INFO] GeoServer Extensions .............................. SUCCESS [  0.226 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19:21 min
[INFO] Finished at: 2014-03-05T16:52:55+08:00
[INFO] Final Memory: 188M/368M
[INFO] ------------------------------------------------------------------------

4.4 通过maven创建eclipse工程文件

执行命令:

mvn eclipse:eclipse

执行结果如下:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] GeoServer ......................................... SUCCESS [ 10.022 s]
[INFO] Core Platform Module .............................. SUCCESS [  6.761 s]
[INFO] Open Web Service Module ........................... SUCCESS [  4.690 s]
[INFO] Main Module ....................................... SUCCESS [  8.291 s]
[INFO] GeoServer Security Modules ........................ SUCCESS [  0.041 s]
[INFO] GeoServer JDBC Security Module .................... SUCCESS [  0.759 s]
[INFO] GeoServer LDAP Security Module .................... SUCCESS [  1.313 s]
[INFO] Web Coverage Service Module ....................... SUCCESS [  0.299 s]
[INFO] Web Coverage Service 1.0 Module ................... SUCCESS [  1.545 s]
[INFO] Web Coverage Service 1.1 Module ................... SUCCESS [  4.898 s]
[INFO] Web Coverage Service 2.0 Module ................... SUCCESS [  0.354 s]
[INFO] Web Feature Service Module ........................ SUCCESS [  0.502 s]
[INFO] Web Map Service Module ............................ SUCCESS [  3.534 s]
[INFO] KML support for GeoServer ......................... SUCCESS [  1.063 s]
[INFO] GeoWebCache (GWC) Module .......................... SUCCESS [  9.024 s]
[INFO] REST Support Module ............................... SUCCESS [  0.285 s]
[INFO] REST Configuration Service Module ................. SUCCESS [  0.484 s]
[INFO] GeoServer Web Modules ............................. SUCCESS [  0.032 s]
[INFO] Core UI Module .................................... SUCCESS [  0.922 s]
[INFO] WMS UI Module ..................................... SUCCESS [  0.338 s]
[INFO] GWC UI Module ..................................... SUCCESS [  1.009 s]
[INFO] WFS UI Module ..................................... SUCCESS [  0.274 s]
[INFO] Demoes Module ..................................... SUCCESS [  0.408 s]
[INFO] WCS UI Module ..................................... SUCCESS [  0.604 s]
[INFO] Security UI Modules ............................... SUCCESS [  0.033 s]
[INFO] Security UI Core Module ........................... SUCCESS [  0.319 s]
[INFO] Security UI JDBC Module ........................... SUCCESS [  0.331 s]
[INFO] Security UI LDAP Module ........................... SUCCESS [  0.401 s]
[INFO] GeoServer Web Application ......................... SUCCESS [  0.595 s]
[INFO] Community Space ................................... SUCCESS [  0.032 s]
[INFO] GeoServer Extensions .............................. SUCCESS [  0.030 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:09 min
[INFO] Finished at: 2014-03-05T17:06:55+08:00
[INFO] Final Memory: 119M/447M
[INFO] ------------------------------------------------------------------------
D:\Technology\Learnning\open_gis\geoserver\geoserver_dev\project\geoserver20140305\src>

5、将工程导入eclipse并运行

5.1 添加Classpath Variables

打开eclipse,选择window下的preference,在对话框中选择java->buildpath->Classpath Variables,点击“new”将本地的maven
    repository路径作为classpath变量添加至工作空间中。

5.2 导入工程

在eclipse中点击 “file”选择“import”将创建的eclipse导入至eclipse中。

import

存在的工程

选择geoserver/src文件夹

导入后,布局如下:

5.3 运行

运行start.java

Console中呈现如下记录:

log4j:WARN File option not set for appender [geoserverlogfile].
log4j:WARN Are you using FileAppender instead of ConsoleAppender?
三月 05, 2014 9:31:37 下午 org.geoserver.platform.GeoServerExtensions checkContext
警告: Extension lookup occured, but ApplicationContext is unset.
05 三月 21:31:37 INFO [geoserver.global] -
----------------------------------
- GEOSERVER_DATA_DIR: D:\Technology\Learnning\open_gis\geoserver\geoserver_dev\project\geoserver20140305\src\web\app\src\main\webapp\data
----------------------------------
05 三月 21:31:38 INFO [org.geoserver] - Loaded style ""line""
05 三月 21:31:38 INFO [org.geoserver] - Loaded style ""point""
05 三月 21:31:38 INFO [org.geoserver] - Loaded style ""polygon""
05 三月 21:31:38 INFO [org.geoserver] - Loaded style ""raster""
05 三月 21:31:38 INFO [org.geoserver] - Loaded default workspace it.geosolutions
05 三月 21:31:38 INFO [org.geoserver] - Loaded workspace ""it.geosolutions""
05 三月 21:31:38 INFO [org.geoserver] - Loaded workspace ""topp""
05 三月 21:31:38 INFO [storage.DefaultStorageFinder] - ************************************************************************************************************
05 三月 21:31:38 INFO [storage.DefaultStorageFinder] - *** Found System environment variable TEMP set to C:\Users\smartmap\AppData
\Local\Temp, using it as the default prefix. ***
05 三月 21:31:38 INFO [storage.DefaultStorageFinder] - *************************************************************************************************************
05 三月 21:31:38 INFO [config.XMLConfiguration] - Will look for geowebcache.xml in ""C:\Users\smartmap\AppData\Local\Temp\geowebcache""
05 三月 21:31:38 INFO [gwc.layer] - Initializing GWC configuration based on GeoServer""s Catalog
05 三月 21:31:38 INFO [gwc.layer] - GeoServer TileLayer store base directory is: D:\Technology\Learnning\open_gis\geoserver\geoserver_dev\project\geoserver20140305\src\web\app\src\main\webapp\data\gwc-layers
05 三月 21:31:38 INFO [gwc.layer] - Loading tile layers D:\Technology\Learnning\open_gis\geoserver\geoserver_dev\project\geoserver20140305\src\web\app\src\main\webapp\data\gwc-layers
05 三月 21:31:38 INFO [gwc.layer] - GWC configuration based on GeoServer""s Catalog loaded successfuly
05 三月 21:31:38 INFO [layer.TileLayerDispatcher] - Configuration GeoServer Catalog Configuration contained no layers.
05 三月 21:31:38 INFO [config.XMLConfiguration] - Found configuration file in C:\Users\smartmap\AppData\Local\Temp\geowebcache
05 三月 21:31:38 WARN [config.XMLConfiguration] - *******************************************************************
05 三月 21:31:38 WARN [config.XMLConfiguration] - *** GWC configuration validation error: cvc-elt.1: 找不到元素 ""gwcConfiguration"" 的声明。
05 三月 21:31:38 WARN [config.XMLConfiguration] - *** Will try to use configuration anyway. Please check the order of declared
elements against the schema.
05 三月 21:31:38 WARN [config.XMLConfiguration] - ************************************************************
05 三月 21:31:38 INFO [config.XMLConfiguration] - Initializing GridSets C:\Users\smartmap\AppData\Local\Temp\geowebcache
05 三月 21:31:38 INFO [config.XMLConfiguration] - Initializing layers C:\Users\smartmap\AppData\Local\Temp\geowebcache
05 三月 21:31:38 INFO [layer.TileLayerDispatcher] - Configuration C:\Users\smartmap\AppData\Local\Temp\geowebcache contained no layers.
05 三月 21:31:39 INFO [diskquota.ConfigLoader] - DiskQuota configuration not found: C:\Users\smartmap\AppData\Local\Temp\geowebcache
\geowebcache-diskquota.xml
05 三月 21:31:39 INFO [diskquota.ConfigLoader] - DiskQuota configuration not found: C:\Users\smartmap\AppData\Local\Temp\geowebcache
\geowebcache-diskquota.xml
05 三月 21:31:39 INFO [diskquota.DiskQuotaMonitor] - Setting up disk quota periodic enforcement task
05 三月 21:31:39 INFO [diskquota.DiskQuotaMonitor] - 0 layers configured with their own quotas.
05 三月 21:31:39 INFO [diskquota.DiskQuotaMonitor] - 0 layers attached to global quota 500.0 MB
05 三月 21:31:39 INFO [diskquota.DiskQuotaMonitor] - Disk quota periodic enforcement task set up every 10 SECONDS
05 三月 21:31:39 INFO [org.geoserver] - Loaded service ""wfs"", enabled
05 三月 21:31:39 INFO [org.geoserver] - Loaded service ""wms"", enabled
05 三月 21:31:39 INFO [org.geoserver] - Loaded service ""wcs"", enabled
05 三月 21:31:39 INFO [gwc.config] - Initializing GeoServer specific GWC configuration gwc-gs.xml
05 三月 21:31:39 INFO [ows.OWSHandlerMapping] - Mapped URL path [/gwc/service/**] onto handler ""dispatcher""
05 三月 21:31:39 INFO [geowebcache.GeoWebCacheDispatcher] - Invoked setServletPrefix(gwc)
05 三月 21:31:39 INFO [georss.GeoRSSPoller] - Initializing GeoRSS poller in a background job...
05 三月 21:31:39 INFO [georss.GeoRSSPoller] - No enabled GeoRSS feeds found, poller will not run.
05 三月 21:31:40 INFO [rest.RESTDispatcher] - Created RESTDispatcher with 14 paths
05 三月 21:31:40 INFO [wms.WMSService] - Will NOT recombine tiles for non-tiling clients.
05 三月 21:31:40 INFO [wms.WMSService] - Will proxy requests to backend that are not getmap or getcapabilities.
05 三月 21:31:40 INFO [ows.OWSHandlerMapping] - Mapped URL path [/ows/**] onto handler ""dispatcher""
05 三月 21:31:40 INFO [ows.OWSHandlerMapping] - Mapped URL path [/ows] onto handler ""dispatcher""
05 三月 21:31:40 INFO [org.geoserver] - GeoServer configuration lock is enabled
05 三月 21:31:41 INFO [ows.OWSHandlerMapping] - Mapped URL path [/wfs/*] onto handler ""dispatcher""
05 三月 21:31:41 INFO [ows.OWSHandlerMapping] - Mapped URL path [/TestWfsPost] onto handler ""wfsTestServlet""
05 三月 21:31:41 INFO [ows.OWSHandlerMapping] - Mapped URL path [/wfs] onto handler ""dispatcher""
05 三月 21:31:45 INFO [ows.OWSHandlerMapping] - Mapped URL path [/wms/*] onto handler ""dispatcher""
05 三月 21:31:45 INFO [ows.OWSHandlerMapping] - Mapped URL path [/wms] onto handler ""dispatcher""
05 三月 21:31:46 INFO [ows.OWSHandlerMapping] - Mapped URL path [/animate] onto handler ""dispatcher""
05 三月 21:31:46 INFO [ows.OWSHandlerMapping] - Mapped URL path [/animate/*] onto handler ""dispatcher""
05 三月 21:31:46 INFO [ows.OWSHandlerMapping] - Mapped URL path [/wcs] onto handler ""dispatcher""
05 三月 21:31:46 INFO [ows.OWSHandlerMapping] - Mapped URL path [/wcs/**] onto handler ""dispatcher""
05 三月 21:31:47 INFO [ows.OWSHandlerMapping] - Mapped URL path [/kml] onto handler ""dispatcher""
05 三月 21:31:47 INFO [ows.OWSHandlerMapping] - Mapped URL path [/kml/*] onto handler ""dispatcher""
05 三月 21:31:47 INFO [ows.OWSHandlerMapping] - Mapped URL path [/kml/icon/**/*] onto handler ""kmlIconService""

之后在浏览器中打开:http://localhost:8080/geoserver/,如下:

如有疑问请联系:

QQ:1004740957

email:[email protected]

时间: 2024-10-07 18:48:43

eclipse中建geoserver源码的相关文章

Eclipse下建立geoserver源码工程

1.http://geoserver.org/download/下载源码 例子:http://sourceforge.net/projects/geoserver/files/GeoServer/2.5.2/geoserver-2.5.2-src.zip 2.下载Maven( http://maven.apache.org/download.cgi )选择apache-maven-3.21-bin.zip,maven是命令行程序,将下载得到的压缩包解压,在使用时临时指定PATH变量即可. 3.打

关于导入geoserver 源码到Eclipse编译运行

参考http://blog.csdn.net/gisshixisheng/article/details/43016443 和  http://blog.sina.com.cn/s/blog_6e3765300102vvh8.html 两篇文章 一.安装JDK环境 1.到到官网下载JDK 最好是1.8.0以上版本,这里jdk jdk-8u101-windows-x64(我的机器是64位,如果是32位,需要32位) 2.安装JDK 一路next,其中jdk安装位置和jre安装位置默认是放在c盘,如

geoserver源码导出war包

题外语:踏破铁鞋无觅处,得来全部费工夫.从网上找了下将Geoserver源码导出为war文件的方法,少之甚少,没办法,百度靠不住,还得靠自己,上Geoserver官网上看了下,又在官方论坛上找了找,说是什么jetty,说实话,不懂哎,就瞎翻的看了看,擦,山重水复疑无路,柳暗花明又一村,竟然就在那,在此note下来,以便后用. 如何在eclipse中构建Geoserver的源码工程,可参考博文http://blog.csdn.net/gisshixisheng/article/details/43

Hadoop1.x目录结构及Eclipse导入Hadoop源码项目

这是解压hadoop后,hadoop-1.2.1目录 各目录结构及说明: Eclipse导入Hadoop源码项目: 注意:如果没有ant的包可以去网上下,不是hadoop里面的. 然后如果通过以上还报错的话,可以右键点击项目,然后如下图(配置**/*):

设置eclipse自动下载源码

有时候,我们会好奇有些包的源码是怎么写的,毕竟源码是学习这个框架的最直接最原始的方法,可是Eclipse无法帮我们自动下载源码,这里推荐一个插件,可以帮我下载想要的源码. Java Source Attacher 插件主页:http://marketplace.eclipse.org/content/java-source-attacher#.U5RmTePp0QI 可以通过eclipse自动安装,也可以手动下载包 今天尝试自动安装貌似很慢,下载包也需要翻墙,我把这个包放在我的资源页,如果有需要

如何在Eclipse中连接源码

最近在很多场合都看见设计模式的影子,一直以来,都投入主要时间在搞算法与数据结构,很来发现设计模式真的很重要.有的时候代码的可维护.可重用.可扩展确实胜过单纯的算法效率高.所以拾起大牛书籍<大话设计模式>同时参考网上诸大牛的博客,开始我的设计模式之旅.由于平时编程时用C/C++,现在是Java,也练练Java语法. 今天先介绍一下命令模式. 概念: 命令模式(Command):将一个请求封装成一个对象,从而使你可用不同的请求对象对客户进行参数化,对请求排队或记录请求日志,以及支持可撤销的操作.

Hadoop大象之旅010-使用eclipse查看hadoop源码

Hadoop大象之旅010-使用eclipse查看hadoop源码 老帅 我这使用的是hadoop-1.1.2.tar.gz,这个文件可以在下面地址下载到: 官方地址:http://archive.apache.org/dist/hadoop/core/hadoop-1.1.2/ 1.将hadoop-1.1.2.tar.gz解压缩 文件夹结构如下所示: 2.在MyEclipse中新建一个JavaProject 工程名称为hadoop 3.复制源码到我们的工程中 复制hadoop-1.1.2源码文

Eclipse 导入 Hadoop 源码

1.准备工作 jdk: eclipse: Maven: libprotoc :https://developers.google.com/protocol-buffers/ hadoop:http://www.apache.org/dyn/closer.cgi/hadoop/common/ 添加开源中国maven库:http://maven.oschina.net/home.html maven\conf\settings.xml <localRepository>path</local

[hadoop]Windows下eclipse导入hadoop源码,编译WordCount

hadoop版本为hadoop1.2.1 eclipse版本为eclipse-standard-kepler-SR2-win32-x86_64 WordCount.java为hadoop-1.2.1\src\examples\org\apache\hadoop\examples\WordCount.java 1 /** 2 * Licensed under the Apache License, Version 2.0 (the "License"); 3 * you may not