JetBrains provide a the IntelliJ IDE, a community edition is available and is documented here.
This IDE is recommended for excellent Maven integration, and very fast build times. It is especially good at working with large multi-module projects such as GeoNetwork.
-
Open project in IntelliJ, it will create an
.ideafolder (which is covered by.gitignore) -
Use File > Project Structure to confirm Java 8 is used
-
Configuration to make Maven tools window easier to follow:
- Group Modules
- Always Show ArtifactId
-
Use the Maven tools window to:
- Enable the
env-devprofile - Toggle "Skip Tests" Mode
- Execute Maven Goal:
clean install
- Enable the
-
After doing the maven build once, select menu Build > Build Project.
-
The build progress is shown in the Build tools window.
-
This is an incremental build, so only modified files are compiled in the future.
-
Menu Run > Edit Configurations...
-
Add new Maven configuration:
-
Working Directory:
core-geonetwork/web -
Command Line:
jetty:run -
Profiles:
env-dev
-
-
Add maven goal
proccess-resourcesbefore launch. -
Run
-
Testing
- http://localhost:8080/geonetwork
- user: admin
- password: admin
-
Live debugging
- Debug using the run configuration created above
- The
env-devallows updates while running - Use Build Project to compile, allowing methods to be rewritten interactively.
- Use Maven tool window to run
mvn process-resourcesto copy changes into the running web application.
-
Open settings:
- Window > Preferences (Windows and Linux)
- IntelliJ IDEA > Preferences (macOS)
-
Navigate to Editor > Code Style > Java.
-
Locate Scheme at the top of the page, and the actions menu.
-
Select **Import Scheme | Eclipse XML Profile **
-
Import the
code_quality/formatter.xml
-
-
Navigate to Editor > File and Code Templates.
-
Change to Includes tab
-
Define File Header:
/* * Copyright (C) ${YEAR} Food and Agriculture Organization of the * United Nations (FAO-UN), United Nations World Food Programme (WFP), * United Nations Environment Programme (UNEP), and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2, * Rome - Italy. email: geonetwork@osgeo.org */
-



