Comments (8)
We were able to solve the issue by manually specifying the descriptor for vertx-web. That workaround solved the issue. I'm closing the issue. Feel free to open it again if you want to check up on the actual cause of the problem.
from moditect.
from moditect.
Sure:
git clone [email protected]:Jotschi/vertx-graalvm-native-image-test.git
git checkout 10ef164d6ccda768abed387e3ee84514487b8885
cd app
mvn clean package
The dev-moditect branch already contains the fixed version.
BTW: Your devoxx presentation about moditect was super helpful. I'm thinking about writing a blogpost to showcase how to deal with older libs in a JMPS environment.
from moditect.
Sure: ...
Cool, I'll take a look. Curious what's going on there.
BTW: Your devoxx presentation about moditect was super helpful.
Thanks, very happy to hear that!
I'm thinking about writing a blogpost to showcase how to deal with older libs in a JMPS environment.
That'd be cool. Let me know if you do it and would like some help with reviewing etc. There are some limitations with retrofitting existing JARs as modules via ModiTect (e.g. thinking of split packages or certain APIs that behave differently when being called from within a named module), but for sure it's a useful tool in the box.
I'll re-open the issue so to have a reminder for this problem.
from moditect.
Hey @Jotschi, did you ever have a chance to follow up on
I'm thinking about writing a blogpost to showcase how to deal with older libs in a JMPS environment.
?
from moditect.
@gunnarmorling No, unfortunately I did not yet have time write a blog post.
I had to postpone the Java update of the product I'm working on. I first need to update some dependencies which turned out to be rather complicated. Once that has been done I'll pick up the task and write a blog post along with the upgrade I'm doing. I'll keep you in the loop.
from moditect.
from moditect.
Hi, the example your provided (thank a lot by the way) works until a Vert.x version <= 3.8.0.
From Vert.X version 3.8.1, Netty version uses some graalvm dependencies to be able to produce native images and it requires some updates.
NB: Change comes from Netty version 4.1.36.Final
Here is a "minimal" pom I tried:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.jotschi.vertx</groupId>
<artifactId>vertx-moditect-jlink-example</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<!-- marker: last working version = 3.8.0 / breaking = 3.8.1 -->
<vertx.version>3.9.1</vertx.version>
<svm.version>19.0.0</svm.version>
</properties>
<dependencies>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web</artifactId>
<version>${vertx.version}</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>11</release>
<compilerArgs>
<compilerArg>--module-path</compilerArg>
<compilerArg>${project.build.directory}/modules</compilerArg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<version>1.0.0.RC1</version>
<executions>
<execution>
<id>add-module-info-to-dependencies</id>
<phase>package</phase>
<configuration>
<outputDirectory>${project.build.directory}/modules</outputDirectory>
<modules>
<module>
<artifact>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</artifact>
<moduleInfo>
<name>com.fasterxml.jackson.core</name>
</moduleInfo>
</module>
<module>
<artifact>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</artifact>
<moduleInfo>
<name>com.fasterxml.jackson.annotations</name>
</moduleInfo>
</module>
<module>
<artifact>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</artifact>
<moduleInfo>
<name>com.fasterxml.jackson.databind</name>
</moduleInfo>
</module>
<module>
<artifact>
<groupId>com.oracle.substratevm</groupId>
<artifactId>svm</artifactId>
<version>${svm.version}</version>
</artifact>
<moduleInfo>
<name>svm</name>
</moduleInfo>
</module>
<module>
<artifact>
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
</artifact>
<moduleInfo>
<name>io.netty.common</name>
</moduleInfo>
</module>
<module>
<artifact>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
</artifact>
<moduleInfo>
<name>io.netty.buffer</name>
</moduleInfo>
</module>
<module>
<artifact>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
</artifact>
<moduleInfo>
<name>io.netty.codec</name>
</moduleInfo>
</module>
<module>
<artifact>
<groupId>io.netty</groupId>
<artifactId>netty-resolver</artifactId>
</artifact>
<moduleInfo>
<name>io.netty.resolver</name>
</moduleInfo>
</module>
<module>
<artifact>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
</artifact>
<moduleInfo>
<name>io.netty.transport</name>
</moduleInfo>
</module>
<module>
<artifact>
<groupId>io.netty</groupId>
<artifactId>netty-codec-dns</artifactId>
</artifact>
<moduleInfo>
<name>io.netty.codec.dns</name>
</moduleInfo>
</module>
<module>
<artifact>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http2</artifactId>
</artifact>
<moduleInfo>
<name>io.netty.codec.http2</name>
</moduleInfo>
</module>
<module>
<artifact>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns</artifactId>
</artifact>
<moduleInfo>
<name>io.netty.resolver.dns</name>
</moduleInfo>
</module>
<module>
<artifact>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
</artifact>
<moduleInfoSource>
module io.netty.handler {
exports io.netty.handler.flow;
exports io.netty.handler.flush;
exports io.netty.handler.ipfilter;
exports io.netty.handler.logging;
exports io.netty.handler.ssl;
exports io.netty.handler.ssl.ocsp;
exports io.netty.handler.ssl.util;
exports io.netty.handler.stream;
exports io.netty.handler.timeout;
exports io.netty.handler.traffic;
}
</moduleInfoSource>
</module>
<module>
<artifact>
<groupId>io.netty</groupId>
<artifactId>netty-codec-socks</artifactId>
</artifact>
<moduleInfo>
<name>io.netty.codec.socks</name>
</moduleInfo>
</module>
<module>
<artifact>
<groupId>io.netty</groupId>
<artifactId>netty-handler-proxy</artifactId>
</artifact>
<moduleInfo>
<name>io.netty.handler.proxy</name>
</moduleInfo>
</module>
<module>
<artifact>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
</artifact>
<moduleInfo>
<name>io.netty.codec.http</name>
</moduleInfo>
</module>
<module>
<artifact>
<groupId>io.vertx</groupId>
<artifactId>vertx-web</artifactId>
</artifact>
<moduleInfoSource>
open module vertx.web {
requires vertx.core;
requires io.netty.codec.http;
exports io.vertx.ext.web;
exports io.vertx.ext.web.handler;
exports io.vertx.ext.web.impl;
}
</moduleInfoSource>
</module>
<module>
<artifact>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
</artifact>
<moduleInfo>
<name>vertx.core</name>
<requires>
static log4j.api;
static log4j;
static slf4j.api;
*;
</requires>
<exports>
*;
</exports>
<uses>
io.vertx.core.spi.VertxFactory;
io.vertx.core.spi.VerticleFactory;
io.vertx.core.spi.FutureFactory;
io.vertx.core.spi.BufferFactory;
</uses>
</moduleInfo>
</module>
</modules>
<module>
<mainClass>de.jotschi.vertx.example.Runner</mainClass>
<moduleInfo>
<name>de.jotschi.vertx.example</name>
<exports>
de.jotschi.vertx.example to io.vertx.core;
</exports>
</moduleInfo>
</module>
<jdepsExtraArgs>
<arg>--multi-release</arg>
<arg>11</arg>
</jdepsExtraArgs>
</configuration>
<goals>
<goal>add-module-info</goal>
</goals>
</execution>
<execution>
<id>create-runtime-image</id>
<phase>package</phase>
<goals>
<goal>create-runtime-image</goal>
</goals>
<configuration>
<modulePath>
<path>${project.build.directory}/modules</path>
</modulePath>
<modules>
<module>de.jotschi.vertx.example</module>
</modules>
<launcher>
<name>helloWorld</name>
<module>de.jotschi.vertx.example</module>
</launcher>
<compression>2</compression>
<stripDebug>true</stripDebug>
<outputDirectory>${project.build.directory}/jlink-image</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I tried several things but I'm stuck with this issue:
Execution add-module-info-to-dependencies of goal org.moditect:moditect-maven-plugin:1.0.0.RC1:add-module-info failed: Module format not recognized: /home/jflorte/.m2/repository/com/oracle/substratevm/svm-hosted-native-linux-amd64/19.0.0/svm-hosted-native-linux-amd64-19.0.0.tar.gz
It seems it tries to enrich a transitive dependency from com.oracle.substratevm:svm:19.0.0 but I don't know how to prevent the plugin from doing so.
If you have any idea, I'd be happy to investigate.
For the record, I also tried with newer versions of Vert.X. Jackson definition can be removed because they added module-info.java files. But the svm (and then asm) issue is still a blocker to me.
from moditect.
Related Issues (20)
- AddModuleInfo does not generate reproducible archives (regression) HOT 13
- maven plugin error after upgrading jackson to 2.15.1 from 2.14.2 HOT 4
- Maven plugin issue with non-existant modules if test modules are included HOT 7
- Add release version to release commit message HOT 2
- Should `copyright.txt` be named `NOTICE.txt`?
- Cannot build vert.x example
- how to pass "--multi-release" to jdeps? HOT 3
- 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
- NullPointerException during create-runtime-image HOT 8
- 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
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.