0

I'm coding a JavaFX project with Maven and the mvvmFX Framework, on the wiki it's mentioned that you need to put all View.java and View.fxml in the same folder, but that's not possible with the Maven architecture, however it's also specified that it should work correctly with Maven as long as the path is the same in the java and ressources folders, so here is a picture of my folder architecture : Folder architecture

But it doesn't work, I have an error, it says that the ressourcepath can't find the specified file.

I tried to include different version of the dependency in the POM.xml, and I also tried to open the module to de.saxsys.mvvmfx, but that didn't work. I'm not an expert in package and module with maven so I'm trying to see if someone knows how I could repair my mistakes.

module-info.java

Dependencies in my POM.xml

Error I get

Artcann
  • 15
  • 1
  • 4
  • 1
    Check the deployment folder (`target/classes` by default with Maven) and see if the FXML file is in the expected place. – James_D Apr 05 '21 at 18:29
  • It seems that the fxml file is in the same folder as the view class when I check the target/classes folder, which is not exactly the same as my current folder. There is no Ressources in the deployment folder. What should I do ? – Artcann Apr 05 '21 at 18:37
  • So you have `target/classes/org/example/helloworld/TestView.fxml`? – James_D Apr 05 '21 at 18:39
  • Yes I do have this – Artcann Apr 05 '21 at 18:42
  • 1
    What if you add the qualified `opens org.example.helloworld to de.saxsys.mvvmfx;` directive to your module-info file? Or even an unqualified opens directive? – Slaw Apr 05 '21 at 21:14
  • Ow ! It's a victory, I still have an error, but not the same ! It's really weird, cause I tried to open org.example to de.saxsys.mvvmfx and it didn't work – Artcann Apr 05 '21 at 21:59
  • Opening `org.example` wouldn't work since the resource is in the `org.example.helloworld` package. – Slaw Apr 06 '21 at 00:32
  • There is also an example on how to use mvvmFX with module system and maven: https://github.com/sialcasa/mvvmFX/tree/develop/examples/jigsaw-example – Manuel Mauky Apr 06 '21 at 13:37

0 Answers0