Skip to content

Conversation

@Munhangyeol
Copy link
Contributor

Closes #13509

Steps to test

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.

module("com.squareup.okhttp3:okhttp", "okhttp3")
module("com.squareup.okhttp3:okhttp-sse", "okhttp3.sse")

module("com.squareup.okhttp3:okhttp-jvm", "okhttp3")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, now two modules have the same name - see line 149.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand your concern. Even though two modules are assigned the same name here, there is no actual conflict because they refer to completely separate artifacts (okhttp vs. okhttp-jvm).

This duplication is currently necessary because some dependencies (such as langchain4j-hugging-face) still require the legacy okhttp artifact, while our project relies on the newer okhttp-jvm from OkHttp 5.x.

Since the Java Module System (JPMS) treats them as distinct jars, and as long as both modules are not loaded into the same named module path, this setup works without any issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's anything wrong or anything I should fix in what I said, please feel free to let me know :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My gut feeling says that overloaded module names will cause issues. Especially when we will switch to use modules as the primary source of dependencies: https://github.com/gradlex-org/java-module-dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overloaded module names could definitely cause issues, especially if we move towards using modules as the primary way of managing dependencies in the future.
I’ll try to look into this and hopefully resolve it by tomorrow or the day after. Please feel free to let me know if there’s anything I missed or should improve!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the dependency tree with the dependencies task, and you're right.
Gradle resolves okhttp to version 5.0.0 automatically because of other dependencies or version conflicts.
However, since langchain4j-hugging-face still relies on the 4.x API, upgrading to 5.0.0 breaks compatibility.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does a separte module name help to avoid module name overloading?

The modules will be on the same path - as JabRef needs all of them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the current situation, module name conflicts are unavoidable, and using separate module names alone does not fundamentally resolve the issue.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

com.squareup.okhttp3:okhttp is not really a module anymore. The Jar is more or less empty now. This is Kotlin multi-platform stuff.

I think it does not end up the Module Path, but is needed by the mechanism that looks at the metadata to create the missing module-info files. That the checks are passing on this PR indicates that everything is ok.

I know that it looks like the name is used twice, but in practice only one of the Jars is used. It's confusing but its Kotlin Multi-Platform libraries "clashing" with JPMS. Maybe add a comment about this to the module("com.squareup.okhttp3:okhttp", "okhttp3") line.

We have a similar situation here with kotlinpoet:

https://github.com/hiero-ledger/hiero-gradle-conventions/blob/main/src/main/kotlin/org.hiero.gradle.base.jpms-modules.gradle.kts#L156-L157

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name okhttp3 is correct because the MANIFEST of com.squareup.okhttp3:okhttp-jvm contains

Automatic-Module-Name: okhttp3

@koppor koppor enabled auto-merge July 11, 2025 10:40
@trag-bot
Copy link

trag-bot bot commented Jul 11, 2025

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

@koppor koppor added this pull request to the merge queue Jul 11, 2025
Merged via the queue into JabRef:main with commit 5014082 Jul 11, 2025
1 check passed
@github-actions github-actions bot mentioned this pull request Jul 11, 2025
Siedlerchr added a commit that referenced this pull request Jul 12, 2025
…-info

* upstream/main:
  Also label PR if good first issue is made (#13526)
  New Crowdin updates (#13529)
  chore(deps): update dependency org.apache.logging.log4j:log4j-to-slf4j to v2.25.1 (#13528)
  chore: bump-okhttp-4.12.0-to-5.0.0 (#13521)
Siedlerchr added a commit that referenced this pull request Aug 2, 2025
* upstream/main:
  Also label PR if good first issue is made (#13526)
  New Crowdin updates (#13529)
  chore(deps): update dependency org.apache.logging.log4j:log4j-to-slf4j to v2.25.1 (#13528)
  chore: bump-okhttp-4.12.0-to-5.0.0 (#13521)
  Have the picker always on top (#13525)
  Refactor PushToApplications and split into logic and GUI (#13514)
  Add field to change HTTP port (#13479)
  Fix trigger of comment
  Use Java 11 isBlank (#13523)
  Add run openrewrite (#13524)
  Comment ion PR just opened (#13522)
  Improve merge logic to prefer valid year and entry type (#13506)
  Update dependency com.konghq:unirest-modules-gson to v4.4.12 (#13517)
  Add rpm target (#13516)
  Revert module name changes for remaining 'unnamed' Jars (#13515)
  fix: revert Java module names to restore Status Log compatibility in JabRef 5.15 (#13511)
  update java vendor in devcontainer and sdkmanrc (#13513)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change module names

3 participants