Closed o4codes closed 3 years ago
There is a property in the build script,
In the template as it ships, the artifactId is...
<artifactId>maven-jpackage-template</artifactId>
...and the java-mod-name property is set to...
If you change the name of your artifact to, say, clipshare, than you should change the name of the java-mod-name to match, as in...
...and...
I would strongly recommend sticking to lower-case only names - some file systems are case dependent, some are case independent.
Let me know if this works!
I'm going to leave this issue open, as I think I can do some stuff to simplify this in the future.
I tried renaming all to lowercase still the issue persists.
The structure of source folder is show below
Does the structure of the project have anything to do with the issue at hand ?
Hmm. The error message is saying that jpackage can't read the module declared in clipShare.jar. That means either it can't find the path (perhaps the space in the name) or there is something wrong with the jar file (perhaps it's missing some configuration info). The jar file in the template project is generated by the moditect-maven-plugin.
Does just checking out a copy of the template, perhaps in a C:\src\test folder with no names and running it work for you?
I removed the spaces and yet still did not work.
I cloned the template and tried with your source code and it worked with your codes. I am starting to feel it's from the structure of my project or probably me having a resource folder, or using fxml instead of building the UI with java or probably it's from the libraries I used ?
It's possible it's a matter of sorting out JavaFX module configuration. jpackage indicating that it can't read the module is the key, of course.
Are you doing man clean install
or just install? Try doing clean for each run first, see if that works, or at least gives you a different error...?
Yeah, if you are using FXML you need to have the javafx.fxml mod loaded. Look for every place that lists the other javafx modes (e.g. javafx.base, javafx.controls) and add javafx.fxml.
Try adding javafx.fxml to the modules-in-use property line like this:
<modules-in-use>javafx.base,javafx.controls,javafx.graphics,javafx.fxml,java.logging</modules-in-use>
As an FYI, here are all the javafx jmods:
javafx.base.jmod javafx.fxml.jmod javafx.media.jmod javafx.web.jmod javafx.controls.jmod javafx.graphics.jmod javafx.swing.jmod
Finally the the native installers is built successfully. The error was coming from the META-INF file. By removing it, the build ran successfully.
On running mvn clean install the build works then hits an error when running the jpackage-win-installer phase. The error it gives out is yielded below:
Bundler EXE Installer Package skipped because of a configuration problem: java.lang.module.FindException: Error reading module: C:\Users\shadrach PC\Documents\programming projects \Maven\clip_share\target\modules\clipShare.jar
Failed to execute goal io.github.wiverson:jtoolprovider-plugin:1.0.23:java-tool (jpackage-win-installer) on project clipShare: jpackage 1 -> [Help 1]
Is there anything cause for this ?