Eclipse下建立geoserver源码工程

来源:互联网 发布:信捷plc流程梯图编程 编辑:程序博客网 时间:2024/05/01 19:31

构建geoserver源码工程

摘要 :本文详细阐述,如何基于geoserver源码构建eclipse工程文件,操作过程中除用到jdk、eclipse意外,还有git和maven,操作系统为windows8。

1安装Git( http://git-scm.com/download/win),下载得到Git-1.9.0-preview2014021 7.exe 文件,直接安装即可。安装成功后,在任何地方右击鼠标都会有菜单“Git GUI Here”和“Git Bash Here”。

2通过git可视化界面程序checkout geoserver源码。点击“Git GUI Here”将出现如下界面,选择“克隆已有版本”,进入源码克隆界面,输入相应的source Location(源码所在位置 git://github.com/geoserver/geoserver.git) 和 Target Location(本地存储位置)。

Checkout 得到的源码结构如下:

3下载Maven( http://maven.apache.org/download.cgi )选择apache-maven-3.21-bin.zip,maven是命令行程序,将下载得到的压缩包解压,在使用时临时指定PATH变量即可。

解压后maven文件的结构如下:

4通过maven将源码构建为工程

4.1打开cmd,将目录跳转至源码所在目录下的src文件中。

4.2执行命令:

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

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

4.3执行命令:

mvn clean install

mvn -DskipTests clean install

注意:第一条命令在构建工程的同时执行测试用例测试类文件,在命令执行过程中有可能会出现错误;第二条命令在构建工程时,不进行测试,不会有测试不通过的异常。

通过maven构建工程

[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] ------------------------------------------------------------------------

D:\Technology\Learnning\open_gis\geoserver\geoserver_dev\project\geoserver20140305\src>mvn -DskipTests clean install

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将构建的java工程导入到eclipe中

0 0