Skip to content

Conversation

@jjohannes
Copy link
Collaborator

@jjohannes jjohannes commented Jun 13, 2025

Closes TODO

As discussed @koppor on Slack, here is a proposal to streamline the Gradle build setup and in particular the dependency management setup. This is in preparation to fully use the "Gradlex Module Plugins". But it is also a good improvement in general.

The main change is that the PR introduces a platform/BOM project for all versions versions/build.gradle.kts. This improves two things:

  • Control transitive versions: All versions – including transitive versions – are controlled here. I found quite some dependency definitions that were only done to put in a different version (not a dependency). This is conceptually wrong in Gradle - see dependency vs dependency constraint. Also there were a lot of excludes that are not necessary. It's better to avoid excludes wherever possible.
  • No version duplication: All versions are now in this one file.

Follow Up

This PR also adds the com.autonomousapps.dependency-analysis plugin. But does not integrate it yet as a permanent check.
A follow up step is to run the plugin – ./gradlew projectHealth – and make all the changes it proposes.

If a dependency is reported unused, you have to check if it is needed at runtime or not:

  • Not needed --> remove
  • Needed --> change scope to runtimeOnly

Maybe with this you can find some actual unused Jar, before embarking in the quest to do gradlex-org/java-module-packaging#57 (comment)

Steps to test

The JARs that are used in the different places should be the same as before after this change.
Please test whatever you do when developing to verify this.

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • [/] Change in CHANGELOG.md described in a way that is understandable for the average user (if change is visible to the user)
  • [/] Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • [/] Screenshots added in PR description (if change is visible to the user)
  • [/] Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • [/] Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@jjohannes jjohannes force-pushed the gradle-build-updates branch from 5ecd747 to a74b53e Compare June 13, 2025 11:51
@jjohannes jjohannes marked this pull request as ready for review June 13, 2025 12:17
@JabRef JabRef deleted a comment from jabref-machine Jun 13, 2025
@JabRef JabRef deleted a comment from trag-bot bot Jun 13, 2025
@JabRef JabRef deleted a comment from jabref-machine Jun 13, 2025
@JabRef JabRef deleted a comment from trag-bot bot Jun 13, 2025
@koppor koppor added the dev: no-bot-comments If set, there should be no comments from our bots label Jun 14, 2025
@JabRef JabRef deleted a comment from jabref-machine Jun 14, 2025
@JabRef JabRef deleted a comment from jabref-machine Jun 14, 2025
@JabRef JabRef deleted a comment from trag-bot bot Jun 14, 2025
koppor
koppor previously approved these changes Jun 16, 2025
@koppor koppor enabled auto-merge June 16, 2025 23:06
@trag-bot
Copy link

trag-bot bot commented Jun 16, 2025

@trag-bot didn't find any issues in the code! ✅✨

@koppor koppor added this pull request to the merge queue Jun 16, 2025
Merged via the queue into JabRef:main with commit 36f9f9d Jun 16, 2025
1 check passed
koppor added a commit to jjohannes/jabref that referenced this pull request Jun 17, 2025
@koppor
Copy link
Member

koppor commented Jun 18, 2025

@jjohannes Do you have experiences with maven central publishing - maybe we need some more adjustments as variable names instead of resolved versions seem (!) to get published: #13371

@jjohannes jjohannes mentioned this pull request Jun 18, 2025
Siedlerchr added a commit to MiguelCBar/jabref that referenced this pull request Jun 18, 2025
* upstream/main: (47 commits)
  Adapt some fetcher tests (JabRef#13370)
  change template issue number (JabRef#13367)
  Refine error message in URLUtil::create (JabRef#13337)
  fix deletion again (JabRef#13369)
  Only prevent failure in publishing from stopping the workflow (JabRef#13368)
  Refactor "enableFileAnnotationsTab" to "smartFileAnnotationsTab" and rewrote shouldShow in FileAnnotationTab as requested in JabRef#13279 (JabRef#13338)
  fix workflow (JabRef#13366)
  Fixamd64linux (JabRef#13365)
  Only delete for arm64 (JabRef#13364)
  New Crowdin updates (JabRef#13363)
  Bump org.junit.jupiter:junit-jupiter-api in /versions (JabRef#13362)
  Bump org.apache.logging.log4j:log4j-to-slf4j in /versions (JabRef#13359)
  Bump com.github.javaparser:javaparser-symbol-solver-core in /versions (JabRef#13361)
  Bump org.junit.platform:junit-platform-launcher in /versions (JabRef#13360)
  Bump com.fasterxml.jackson.datatype:jackson-datatype-jsr310 in /versions (JabRef#13358)
  Gradle build updates (JabRef#13319)
  Add "Disable GitHub actions" (JabRef#13356)
  Make jabref host executable on mac and on linux and fix import command line argument (JabRef#13355)
  Delete .github/workflows/merge-upstream.yml (JabRef#13357)
  chore(deps): update dependency org.apache.logging.log4j:log4j-to-slf4j to v2.25.0 (JabRef#13353)
  ...
Siedlerchr added a commit to ganesh-vk/jabref that referenced this pull request Jun 18, 2025
* upstream/main: (54 commits)
  Move publishing to maven central to a separate workflow (JabRef#13372)
  Add more guards to workflows not running on forked JabRef repos
  Copy real HTML from entry preview (JabRef#13339)
  Adapt some fetcher tests (JabRef#13370)
  change template issue number (JabRef#13367)
  Refine error message in URLUtil::create (JabRef#13337)
  fix deletion again (JabRef#13369)
  Only prevent failure in publishing from stopping the workflow (JabRef#13368)
  Refactor "enableFileAnnotationsTab" to "smartFileAnnotationsTab" and rewrote shouldShow in FileAnnotationTab as requested in JabRef#13279 (JabRef#13338)
  fix workflow (JabRef#13366)
  Fixamd64linux (JabRef#13365)
  Only delete for arm64 (JabRef#13364)
  New Crowdin updates (JabRef#13363)
  Bump org.junit.jupiter:junit-jupiter-api in /versions (JabRef#13362)
  Bump org.apache.logging.log4j:log4j-to-slf4j in /versions (JabRef#13359)
  Bump com.github.javaparser:javaparser-symbol-solver-core in /versions (JabRef#13361)
  Bump org.junit.platform:junit-platform-launcher in /versions (JabRef#13360)
  Bump com.fasterxml.jackson.datatype:jackson-datatype-jsr310 in /versions (JabRef#13358)
  Gradle build updates (JabRef#13319)
  Add "Disable GitHub actions" (JabRef#13356)
  ...
@koppor koppor mentioned this pull request Jun 18, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev: no-bot-comments If set, there should be no comments from our bots

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants