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

NPE in create-runtime-image if jar not created #243

Open
ekpeters opened this issue Mar 19, 2024 · 2 comments
Open

NPE in create-runtime-image if jar not created #243

ekpeters opened this issue Mar 19, 2024 · 2 comments

Comments

@ekpeters
Copy link

Versions tested: Moditect 1.0.0.RC2, Moditect 1.2.0.Final

Step 1) Create a maven project.
Important: Include no source files.
For the maven-jar-plugin, set skipIfEmpty to true.

Jar creation will be skipped (as there are no source files) - which may be normal if one splits a project up by task (build the individual jars in individual projects, from a separate project, lump them into an image).

Apologies, I'm not actually trying to break Moditect - just saw a warning I thought I'd try to suppress.

  • [WARNING] JAR will be empty - no content was marked for inclusion!
    Good news, I can suppress it. Bad news, Moditect threw an NPE about 4 steps later in my build. XD
@aalmiray
Copy link
Contributor

The NPE could be caught and a warning/error could be written out.

ModiTect is not supposed to be used with a project that does not produce a JAR.

@ekpeters
Copy link
Author

ekpeters commented Apr 15, 2024

Then why do you let it work on dependencies?
We have one project that exists expressly to pull all dependencies together into an installation image. That includes pulling in third party jars and giving them the module-info files that jlink will require (which is a separate project that creates no jar files - it consumes the zip file.

We have a second project that consumes the zip file produced by this and runs it through jlink (something that moditect has)- again producing no jar file.

We have a third project that consumes the zip file and puts it to other uses... it's not like we can lump everything neatly into one project - it's all subdivided for good reasons.

We even have a project that needs to replace the module-info a 3rd party jar - because the person who put the original into it was not up to speed on how module-info files work -> they got it wrong, and last I looked it hadn't been fixed.

"ModiTect is not supposed to be used with a project that does not produce a JAR."

Why? What is the purpose for this limitation? Without a stated reason for the limitation, my vision ends at the point where the plugin ties my hands.

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

2 participants