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

Required module missing in jlink-merged "module-info.java" #276

Open
autumoswitzerland opened this issue Oct 18, 2024 · 0 comments
Open

Comments

@autumoswitzerland
Copy link

autumoswitzerland commented Oct 18, 2024

Preamble:

I am not 100% sure if it's an error of this plugin, it might be just a usage problem.

Description

I have a modular Java FX project and module "autumo.ui.demo", which uses some JAR libs. One is the dependency "ch.autumo.commons:autumo-commons:1.1.0", which is a maven build that was created with an automatic module "autumo.commons". So far so good. This library has a maven-dependency to "commons-dbutils:commons-dbutils:1.8.1" that seems to be not a module when looking at its POM file (https://github.com/apache/commons-dbutils/blob/rel/commons-dbutils-1.8.1/pom.xml).

Problem

Now when executing jlink, a merged "module-info.java" is created which has these 2 uses:

  • uses org.apache.commons.dbutils.PropertyHandler;
  • uses org.apache.commons.dbutils.ColumnHandler;

These 2 uses are imported in a class in the "autumo.commons" module; so this is correct. But then in the "Task :createMergedModule" this happens:

/Users/Mike/Development/git/repository/autumo-ui-demo/build/jlinkbase/tmpjars/ch.autumo.ui.merged.module/module-info.java:218: Fehler: Package org.apache.commons.dbutils ist nicht vorhanden
    uses org.apache.commons.dbutils.PropertyHandler;
                                   ^
/Users/Mike/Development/git/repository/autumo-ui-demo/build/jlinkbase/tmpjars/ch.autumo.ui.merged.module/module-info.java:219: Fehler: Package org.apache.commons.dbutils ist nicht vorhanden
    uses org.apache.commons.dbutils.ColumnHandler;
                                   ^
2 Fehler

The merged "module-info.java" does NOT have the following "requires" or something similar:

  • requires org.apache.commons.dbutils;

I think this is could the problem. It is not detected as a (automatic) module that is needed for the 2 "uses".

How do I achieve that these 2 "uses" do not fail in the build process?

Some infos:

  • org.beryx.jlink 2.26.0
  • Gradle 8.10.2
  • Kotlin 1.9.24
  • Groovy 3.0.22
  • Apache Ant(TM) version 1.10.14 compiled on August 16 2023
  • Launcher JVM: 21.0.3 (Oracle Corporation 21.0.3+7-LTS-152)
  • Daemon JVM: /Library/Java/JavaVirtualMachines/jdk-21.0.3.jdk/Contents/Home (no JDK specified, using current Java home)
  • OS: Mac OS X 14.5 x86_64

Attached files:

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

No branches or pull requests

1 participant