IntelliJ QuickStart¶
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.21.x
2.22.x
* main
Choose main
for the latest development.:
% git checkout main
Or chose a stable branch for versions less likely to change often:
% git checkout 2.22.x
In this example we will pretend that your source code is in a directory
called geoserver
, but a more descriptive name is recommended.
Import modules into IntelliJ¶
Run the IntelliJ IDE
From the initial panel select
Open
.Navigate to the
geoserver/src/pom.xml
directory and clickOK
.When asked click on
Open as a Project
.Optionally, depending on which platform, IntelliJ may ask to
Trust the Project
.Wait for IntelliJ to
Sync
the dependencies, it’s possible to follow the process from theBuild
tab panel on the bottom.
Finalize the GeoServer Project configuration¶
Run GeoServer from IntelliJ¶
From the Project browser select the
web-app
moduleNavigate to the
org.geoserver.web
packageRight-click the
Start
class and click toModify Run Configuration...
It is important to correctly set the
Working directory
tosrc/web/app
. While having theEdit Configurations
dialog open, fine tune the launch environment (including setting aGEOSERVER_DATA_DIR
or thejetty.port
). When settings are satisfactory, clickOK
.It’s possible now to run GeoServer by selecting
Run -> Run 'Start'
Troubleshooting¶
If there are errors such as “cannot find symbol class ASTAxisId”, some generated code is not being included in the build. Using
wcs1_1
as the working directory, run amvn clean install
.- In the case of compiler errors like
java.lang.NoSuchMethodError
, it might be due toError Prone
. This tool is switched off by default, but sometimes it turns on after import to IntelliJ. There are two options to fix it: Go to Maven tool window and uncheck the
errorprone
profile, then clickReimport All Maven Projects
:To use
errorprone
, notably to perform the QA checks, install theError Prone Compiler
plugin, restart the IDE and setJavac with error-prone
as a default compiler for the project. Please note that this will slow down the build.
- In the case of compiler errors like
If there are errors such as “cannot find symbol AbstractUserGroupServiceTest”, rebuild the
security-tests
project in the security module. Right-click on thesecurity-tests
project and click Rebuild.In the last versions of IntelliJ Annotations processors are enabled. If there are errors because of this uncheck this option from compiler settings.
If IntelliJ complains with an error message like
Command line is too long.
, click onShorten the command line and run.
Note
If there’s a server running on localhost:8080 please check the Eclipse Guide for instructions on changing to a different port.
Run GeoServer with Extensions¶
The above instructions assume running GeoServer without any extensions enabled. In cases where certain extensions are needed, the web-app
module declares a number of profiles that will enable specific extensions when running Start
. To enable an extension, open the Maven Projects
tool and select the profile(s) to enable.
The full list of supported profiles can be found in src/web/app/pom.xml
.
In order to sync the GeoServer execution with the new modules, from the Maven Projects
tool click the Reload All Maven Project
button (1), then Build the Project
(2) and, once finished, Run 'Start'
(3).
Access GeoServer front page¶
After a few seconds, GeoServer should be accessible at: http://localhost:8080/geoserver
The default
admin
password isgeoserver
.