Eclipse M2 Quickstart¶
This guide is designed to get developers up and running as quick as possible. For a more comprehensive guide see the Eclipse Guide.
Check out source code¶
Check out the source code from the git repository.:
git clone git://github.com/geoserver/geoserver.git geoserver
To list the available branches.:
% git branch
2.15.x
2.16.x
* master
Choose master
for the latest development.:
% git checkout master
Or chose a stable branch for versions less likely to change often:
% git checkout 2.16.x
In this example we will pretend that your source code is in a directory
called geoserver
, but a more descriptive name is recommended.
Eclipse Maven builder¶
The maven build supplied with eclipse works with the pom.xml
files, however it does recognize some of our custom build steps:
Go to Preferences and navigate to
Change the Plugin execution not covered by lifecycle configuration to
Warning
.
java-cc-maven-plugin¶
The Eclipse M2 builder does recognize this plugin, build once on the command line first:
Navigate to :file:`src/wcs1_1`.
Compile, to force the code to be generated:
mvn compile
[INFO] --- javacc-maven-plugin:2.3:jjtree (jjtree) @ gs-wcs1_1 --- Java Compiler Compiler Version 4.0 (Tree Builder) (type "jjtree" with no arguments for help) "src/wcs1_1/target/jjtree/org/geoserver/wcs/kvp/rangesubset/ASTFieldId.java" does not exist. Will create one. ... Annotated grammar generated successfully in src/wcs1_1/target/jjtree/org/geoserver/wcs/kvp/rangesubset/rangeset.jj [INFO] [INFO] --- javacc-maven-plugin:2.3:javacc (javacc) @ gs-wcs1_1 --- Java Compiler Compiler Version 4.0 (Parser Generator) (type "javacc" with no arguments for help) Reading from file src/wcs1_1/target/jjtree/org/geoserver/wcs/kvp/rangesubset/rangeset.jj . . . File "TokenMgrError.java" does not exist. Will create one. File "ParseException.java" does not exist. Will create one. ... Parser generated successfully. [INFO] [INFO] --- fmt-maven-plugin:2.4.0:format (default) @ gs-wcs1_1 --- [debug] Using AOSP style [INFO] Processed 47 files (0 reformatted). [INFO]
Import modules into Eclipse¶
Use Import wizard. Select import wizard, and Next.
to open theDefine the Root Directory by browsing to the GeoServer
src
folder.Open Advanced options:
Profiles: release
Name template: [groupId].[artifactId]
Press Finish to start import.
During import use
Resolve Later
, exclude lifecycle mapping.
Run GeoServer from Eclipse¶
From the
Package Explorer
select theweb-app
moduleNavigate to the
org.geoserver.web
packageRight-click the
Start
class and navigate toRun as
,Java Application
After running the first time you can return to the
Run Configurations
dialog to fine tune your launch environment (including setting a GEOSERVER_DATA_DIR).
Note
If you already have a server running on localhost:8080 see the Eclipse Guide for instructions on changing to a different port.
Access GeoServer front page¶
After a few seconds, GeoServer should be accessible at: http://localhost:8080/geoserver
The default
admin
password isgeoserver
.