javalin / javalin-rendering

Artifact/module for server-side template/markdown rendering in Javalin: https://javalin.io/plugins/rendering
Apache License 2.0
10 stars 7 forks source link

Java Modules: package io.javalin.rendering.template is not visible #24

Closed Dylan700 closed 10 months ago

Dylan700 commented 1 year ago

Hey Team,

I'm trying to use this dependency in my Gradle project. Additionally, I am using the java module system.

I am receiving the following error:

/mywebsite/app/src/main/java/website/App.java:19: error: package io.javalin.rendering.template is not visible
import io.javalin.rendering.template.JavalinMustache;
                           ^
  (package io.javalin.rendering.template is declared in the unnamed module, but module website does not read it)

If I temporarily disable the java modules everything works fine. Additionally, I am able to load Javalin fine if I don't use any of the rendering engine functionality. However, I am required to use the module system for my project, and the rendering engine is quite important.

Any ideas how to fix this?

EDIT: I have temporarily fixed this by writing a custom implementation of the JavalinMustache class

tipsy commented 1 year ago

Hi @Dylan700, this project isn't modularized - would you like to submit a PR to fix that?

Dylan700 commented 1 year ago

Hi @tipsy, sure thing. I've just created a draft PR for this, however, I'm not entirely familiar with Kotlin and I'm receiving an error with compiling the tests. Could you take a look? (Strangely the actual project compiles correctly, but it seems the modularization is causing issues with the tests)