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 * main
main for the latest development.:
% git checkout main
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
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
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:
[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 the
Define the Root Directory by browsing to the GeoServer
Open Advanced options:
Name template: [groupId].[artifactId]
Press Finish to start import.
During import use
Resolve Later, exclude lifecycle mapping.
Run GeoServer from Eclipse¶
Package Explorerselect the
Navigate to the
Startclass and navigate to
After running the first time you can return to the
Run Configurationsdialog to fine tune your launch environment (including setting a GEOSERVER_DATA_DIR).
If you already have a server running on localhost:8080 see the Eclipse Guide for instructions on changing to a different port.