GeoServer学习手记(二):代码下载及在Eclipse中加载

GeoServer学习手记(二):代码下载及在Eclipse中加载

粟卫民http://www.gisdev.cn/ http://blog.csdn.net/suen/ 日期:2009-10-19

保留所有版权。如需转载,请联系作者,并在醒目位置注明出处

前面概述了GeoServer的功能(GeoServer学习手记(一):GeoServer概述,http://blog.csdn.net/suen/archive/2009/10/25/4726204.aspx),接下来我们慢慢来分析它的代码。

分析代码的第一步肯定是在IDE中打开代码,没想到打开GeoServer的代码还有一点点复杂,所以先把这个介绍一下。

(1)  下载GeoServer代码:

可以直接通过HTTP下载(http://geoserver.org/display/GEOS/Download),也可以使用SVNsvn co https://svn.codehaus.org/geoserver/branches/1.7.x geoserver_1.7.x

(2)  使用Maven生成代码:

cd geoserver_1.7.x/src

mvn clean install

这一步的时间比较长,因为Maven要联网下载java包,如果没有生成成功也不用担心,可反复执行mvn install,它会重新下载没有下载成功的包。

(3)  生成Eclipse工程文件:

mvn eclipse:eclipse

(4)  Eclipse中导入模块:

a)    Run the Eclipse ide

b)    Open the Eclipse Preferences

c)    Navigate to Java, Build Path, Classpath Variables and click New…

 

 

d)    Create a classpath variable named “M2_REPO” and set the value to the location of the local Maven repository, and click `Ok

 

e)    Click Ok to apply the new Eclipse preferences

f)    Right-click in the Package Explorer and click Import…

 

g)    Select Existing Projects into Workspace and click Next

 

h)    Navigate to the geoserver_1.7.x/src directory

i)    Ensure all modules are selected and click Finish

 

 

(5)  Eclipse中打开代码:

导入已经存在的工作空间,使用Geoserver源码目录,选择所有的模块,点击完成即可。可看见cofigdatageoserver-archetype-wfsoutputformatgwcmainowsplatformrestvalidationwcswcs1_1webwfswfs11wms等多个工程。

转载自:https://blog.csdn.net/suen/article/details/4726733

You may also like...