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.14.x
   2.15.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.14.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

  1. Run the Intellij IDE

  2. Select File -> New -> Project from Existing Sources....

  3. Navigate to the geoserver/src/pom.xml directory and click Open.

    ../_images/intellij_import.png
  4. Click Next, leaving all profiles unchecked.

    ../_images/intellij_import_profile.png
  5. Click Next, leaving the geoserver project checked.

    ../_images/intellij_import_project.png
  6. Click Next, selecting the Java 8 JDK of your choice.

    ../_images/intellij_import_jdk.png
  7. Click Finish

    ../_images/intellij_import_finish.png

Run GeoServer from Intellij

  1. From the Project browser select the web-app module

  2. Navigate to the org.geoserver.web package

  3. Right-click the Start class and click to Run 'Start.main()'

    ../_images/intellij_run.png
  4. The first time you do this, geoserver will fail to start. Navigate to the Run menu, an click Edit Configurations....

  5. Select the Start configuration, and append web/app to the Working Directory.

    ../_images/intellij_run_config.png
  6. 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, click OK.

  7. 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.

../_images/intellij_run_profile.png

The full list of supported profiles can be found in src/web/app/pom.xml.

Access GeoServer front page