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.15.x
2.16.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.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.
Import modules into IntelliJ¶
Run the IntelliJ IDE
Select
File -> New -> Project from Existing Sources...
.Navigate to the
geoserver/src/pom.xml
directory and clickOpen
.Click
Next
, leaving all profiles unchecked.Click
Next
, leaving the geoserver project checked.Click
Next
, selecting the Java 8 JDK of your choice.Click
Finish
Before Running GeoServer¶
GeoServer relies on other libraries that are maintained in parallel under the same project umbrella. These are GeoTools and GeoWebCache. So, for easier installation and setup of the GeoServer development environment, you may want to apply the following:
- Download the code of both and execute
mvn clean install
into them.
- Download the code of both and execute
Afterwards do the same in the GeoServer src folder
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 toRun 'Start.main()'
The first time you do this, GeoServer will fail to start. Navigate to the
Run
menu, and clickEdit Configurations...
.Select the
Start
configuration, and appendweb/app
to theWorking Directory
.While you have the
Edit Configurations
dialog open, you can fine tune your launch environment (including setting a GEOSERVER_DATA_DIR). When you are happy with your settings, clickOK
.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 a
mvn clean install
.- If you get a compiler error like java.lang.NoSuchMethodError, it is most likely due to
Error Prone
tool which doesn’t support Java 8. 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
:If you want 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 slower the build.
- If you get a compiler error like java.lang.NoSuchMethodError, it is most likely due to
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.
You can now re-run GeoServer. Select
Run -> Run 'Start'
Note
If you already have a server running on localhost:8080 see the Eclipse Guide for instructions on changing to a different port.
Run GeoServer with Extensions¶
The above instructions assume you want to run GeoServer without any extensions enabled. In cases where you do need certain extensions, 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
window (View -> Tool Windows -> Maven Projects
) and select the profile(s) you want to enable.
The full list of supported profiles can be found in src/web/app/pom.xml
.
Access GeoServer front page¶
After a few seconds, GeoServer should be accessible at: http://localhost:8080/geoserver
The default
admin
password isgeoserver
.
Run GeoServer from IntelliJ on Windows¶
Add bash to your Windows environment path and restart IntelliJ.