Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code paths that cause errors on Windows #8355

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions software_development/INTELLIJ.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
# IntelliJ IDE

JetBrains provide a the IntelliJ IDE, a community edition is available and
is documented here.
JetBrains provide the IntelliJ IDE, a community edition is available [here](https://www.jetbrains.com/idea/download/).

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.

If you are running on Windows, it might make sense to set up the project in the WSL to run unit tests.
See the [Testing Documentation](TESTING.md) for more details.

## Setting up

1. Open project in IntelliJ, it will create an `.idea` folder (which is covered by `.gitignore`)

2. Use *File* > *Project Structure* to confirm Java 8 is used
2. Use *File* > *Project Structure* to confirm Java 11 is used. If you have cloned the Repo in the WSL filesystem, make sure the WSL version is selected

4. Configuration to make *Maven* tools window easier to follow:
3. Configuration to make *Maven* tools window easier to follow:

* *Group Modules*
* *Always Show ArtifactId*

![configuration](intelij-maven-config.png)

5. Use the *Maven* tools window to:
4. Use the *Maven* tools window to:

* Enable the `env-dev` profile
* *Toggle "Skip Tests" Mode*
Expand Down
5 changes: 3 additions & 2 deletions software_development/SOURCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ cd core-geonetwork
mvn clean install -DskipTests
```

Submodules
----------
If you are using Windows and want to run unit tests, consider cloning the repo into the WSL as described in the [Testing Documentation](TESTING.md)

## Submodules

GeoNetwork use submodules, these were initialized by the ``--recursive`` option when cloning the repository.

Expand Down
9 changes: 9 additions & 0 deletions software_development/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,12 @@ The following list provides a few tips:
be used to mock responses when performing tests.

* Integration tests are disabled by default. Use the `it` maven profile to use them.

## Caveats when using Windows

Some unit tests are designed to expect LF line seperators, which makes them fail on Windows.
For these Tests to run correctly, you should set up the project in the [WSL](https://learn.microsoft.com/en-us/windows/wsl/install).
Once you have installed the WSL, make sure to clone the repo into the WSL filesystem and install the correct java and maven.

If you are using IntelliJ, you can also use the WSL filesystem as the project root.
See the [IntelliJ Docs](https://www.jetbrains.com/help/idea/how-to-use-wsl-development-environment-in-product.html#open-a-project-in-wsl) regarding WSL integration and the [IntelliJ IDE](INTELLIJ.md) instructions for general setup.
4 changes: 2 additions & 2 deletions software_development/TOOLS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tools

GeoNetwork is a Java Web Application, developed using Java 8, Maven.
GeoNetwork is a Java Web Application, developed using Java and Maven.

Documentation makes use of the python Sphinx build system.

Expand Down Expand Up @@ -68,7 +68,7 @@ Maven repository is available at repo.osgeo.org:

GeoNetwork Reference

* [software_development/building](BUIDLING.md)
* [software_development/building](BUILDING.md)
* [web](../web/README.md)

Reference:
Expand Down