-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add module-info.java file #25
Conversation
Unfortunately I'm not very experience with modules, but you can see what was done by @SentryMan for the main artifact: |
Thanks for the info, I've figured it out. Everything seems to be working fine on my end now. |
Great! Could you also add this at build time? (second PR I linked) |
Sure, although are you sure this is necessary? When you say build time, do you mean generating/compiling the jar with The reason I ask is because I have currently imported the generated jar and checked the module info with Let me know what you think. |
The project breaks in IntelliJ, so this is unfortunately required (see javalin/javalin#1922) |
I have not actually tested this one though, but I assume it's going to be the same. If you can confirm that tests can still be run from IntelliJ, then this is not needed :) |
Oh ok that makes sense, thanks. I do not usually use IntelliJ but I'll confirm this and get back to you when I get the chance. |
Are you testing it in intellij now? 😊 |
Hey @tipsy, Yep, currently trying to sort this out 😆 When I add the moditech package as per the second PR linked, I receive this error: It seems that particular plugin is not needed in our case? Running the tests through a JUnit configuration in IntelliJ returns an error, however, setting up a configuration for maven works perfectly. |
Yeah, this is what we are trying to avoid by including it during build. Could you include the plugin? |
Hi @tipsy, I've added the moditech plugin. Since you're more familiar with the project, could you please check if this is working on your end before merging? |
Thanks @Dylan700 ! You will also need to move the module-info to the root:
|
No worries at all @tipsy. I've just made that change, let me know if there's anything else. |
Looks great, thank you! |
Shows how much I know... ! All builds are failing with this error now:
|
Ah dang, what was the command you used for that? I'm not sure how maven works exactly, but I know that for gradle, the module-info.java file needs to be in the src folder. If you go back to commit 0117ced, do you get the same error? That commit works for me when running |
I'll try later today! |
I have no idea what's going on here @Dylan700 - @SentryMan can you see what's wrong? |
Yeah, from my experience, IntelliJ is very temperamental. It definitely works via the command line in the previous commits, but not through IntelliJ. Hopefully SentryMan can help us out! |
try adding |
Thank @SentryMan, upon adding the suggested configuration, I realised that maybe the test class needs its own module.info file. This new commit currently works with |
Just removed the moditech plugin, the workflow checks should pass now. Might be worth adding another check for using this in a modular project too to ensure it definitely works. Will also need someone to check it works on IntelliJ |
Without the plugin I think we would unfortunately be back at square one :/ I'll check it out locally to confirm. Edit: Yes, not working in IntelliJ without the plugin. |
@Dylan700 I moved the
|
Don't ask me why this works, but it does... 😓 |
@tipsy, awesome thanks heaps for confirming, haha as long as it's working I'm happy 😂 Did you put it into a commit? |
No, you can have that honor 😄 |
Haha ok, just added it back. Although the command |
Not seeing any commit yet 😄 |
There we go 😆 |
Still need to move the module-info.java file to meta/module-info.java. I think you can delete the one from the test folder. |
@tipsy, done |
🤞 |
Thanks @Dylan700 , looks like it went through! |
Awesome, thanks for your assistance with this! |
Following #24, I have added a
module-info.java
file to the repository to modularize this project.Unfortunately, 2 template engine libraries cannot be included since they are not modularized themselves, and do not contain automatic-module-name entries:
However, this particular issue should only affect others using this project if they are using the java module system (non-modular projects using this dependency should be fine).
Furthermore, while this code does successfully compile with
mvn package
, I am receiving errors with the tests.I can successfully generate a
.jar
file with the module information by runningmvn package -Dmaven.test.skip
, however, this is not a good solution to that problem.