From 5808f0dde86d05d630a419e8e7bf40c5202e34e3 Mon Sep 17 00:00:00 2001 From: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com> Date: Mon, 14 Oct 2024 22:34:18 +0200 Subject: [PATCH] Enhance doc --- docs/code-howtos/fetchers.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/code-howtos/fetchers.md b/docs/code-howtos/fetchers.md index 627ca12174c..591a8e88d16 100644 --- a/docs/code-howtos/fetchers.md +++ b/docs/code-howtos/fetchers.md @@ -76,11 +76,17 @@ In `build.gradle`, these variables are filled: "springerNatureAPIKey" : System.getenv('SpringerNatureAPIKey') ``` -The `BuildInfo` class reads from that file and the key needs to be put into the map of default api keys in `JabRefCliPreferences::getDefaultFetcherKeys` +The `BuildInfo` class reads from that file and the key needs to be put into the map of default api keys in `JabRefCliPreferences::getDefaultFetcherKeys`. ```java keys.put(SpringerFetcher.FETCHER_NAME, buildInfo.springerNatureAPIKey); ``` +The fetcher api key can then be obtained by calling the preferences. + +```java +importerPreferences.getApiKey(SpringerFetcher.FETCHER_NAME); +``` + When executing `./gradlew run`, gradle executes `processResources` and populates `build/build.properties` accordingly. However, when working directly in the IDE, Eclipse keeps reading `build.properties` from `src/main/resources`. In IntelliJ, the task `JabRef Main` is executing `./gradlew processResources` before running JabRef from the IDE to ensure the `build.properties` is properly populated.