Comments (8)
(Apparently there are issues pasting xml into the editor here... what the issue system is showing most of the pom, and my attempts to fix it did not improve it any - though making it worse turns out to be trivial - if there's a magic trick to remedy that, I don't know it)
from moditect.
@ekpeters When you say "Works fine in release 1.0.0.RC1", what does that mean?
a) the plugin creates a runtime image that includes the JAR
b) the plugin creates a runtime image that DOES NOT include the JAR
c) the plugin does not create an image and fails silently
d) something else
Because as far as I can tell:
a) this should not have happened unless the JAR exists somehow and it's found by the plugin using regular filesystem APIs instead of expecting the artifact to be attached to the current Maven session, which is what I suspect is happening in later versions and should happen.
b) if the JAR is read from the attached artifact set (expectation) and its not found then the runtime would not contain it. Possible but unlikely as that would break the original goal of the invoked mojo.
c) if so, that's a bug. the fact that there's an error (even an NPE) is better.
from moditect.
Can you try just using moduleInfoSource, please?
from moditect.
That was a while back, my memory's a bit fuzzy, but that I recall it was one headache on top of another... the whole 'one step forward three steps back' nonsense.
Looking at the state of things and what was done...
Old:
A single maven project performing the following tasks.
- Collects all dependencies into target/libs (maven-dependeny-plugin - copy-dependencies)
- Copies modular jars from target/libs into target/modules. (maven-resources-plugin - copy-resources)
- uses Moditect to modularize jars in target/libs that are not already modular, or to apply corrections to the odd defective module-info (because not everyone making modular jars knows how to make correct modular jars), output going to target/modules. This is done exclusively using moduleInfoFile to specify each module in full.
- Do other work (cut DLLs from some jars - we don't need 2 copies of DLLs, and some are big).
- create a jlink image with the resources in target/modules
- More work (pack cut DLLs into the created image).
- Pack the image into a zip file.
- Push the resulting zip file (and not any jars - those can/do confuse support) to the maven repo.
This blows up on RC2 with a NPE...
CreateRuntimeImageMojo.java:129
New:
One maven project (packaging: jar) that does all the above work, but has all install/deploy tasks suppressed. Hard coded to Moditect 1.0.0.RC1 (overrides dependency management)
Then a second project (packaging: pom) that reaches into ../prepare/target to deploy the resulting zip archive to the maven repo (because moditect won't do the work under pom packaging - but that's unrelated to this issue...)
Dunno... could that shuffling of jars around be what mucks things up - ultimately we have one set of jars pulled in with the dependency plugin, and then Moditect is making updated copies of the same jars, in a different folder, which ultimately is the folder we use for the jlink image...
from moditect.
The create-runtime-image
is bound by default to the package
lifecycle phase. You have explicitly rebound the goal to generate-resources
which runs much earlier and the project's artifact is not yet ready. The NPE occurs at
ModiTect is failing as it should as the expectation is to create a runtime image with the project's artifact as an input.
from moditect.
@aalmiray I can create a PR with a nicer error message, if that is acceptable to you all?
from moditect.
(and I'm coming back late to the conversation late... meh)
From my perspective, the artifact is a zip file, as that's what is pushed to the maven repo... I realize maven has it's own ideas on the matter, but there's no source to compile, no jar, ear, or war to assemble - Instead of those, it's a zip file, consuming the output of 20-odd projects and ~20 or so 3rd party jars
from moditect.
🎉 This issue has been resolved in 1.2.0.Final
(Release Notes)
from moditect.
Related Issues (20)
- drop scanning transitive dependencies HOT 2
- jdepsExtraArgs gotcha HOT 2
- Support or document how to generate module info for a Maven plugin HOT 4
- Support for new Compression vars HOT 6
- add-module-info no longer allows replacing the existing module-info in a jar HOT 1
- Update Maven deployment strategy HOT 1
- Ability to replace dependencies HOT 1
- `add-module-info` of moditect-maven-plugin fails for multi-module projects, Shade plugin with "xxx-[version].jar is already modular" HOT 4
- Generated JAR file depends on default time zone HOT 10
- [BUILD] Use ${maven.multiModuleProjectDirectory} instead of directory-maven-plugin HOT 2
- Java 22 support HOT 1
- [BUILD] update build to require Java 11+ for building HOT 23
- Contributing CDI SE Example HOT 2
- problem about .\module-info.class and META-INF\services\9 HOT 9
- Update license and maven configuration HOT 1
- NPE in create-runtime-image if jar not created HOT 2
- 1.2.0.Final break builds where 1.1.0 works (Apache Commons IO): `add-module-info failed: Couldn't copy JAR file` HOT 9
- Cannot run verify twice without clean - build complains about split packages HOT 4
- Execution add-module-infos of goal org.moditect:moditect-maven-plugin:1.2.1.Final:add-module-info failed: Encountered unexpected token: "-" "-" HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moditect.