英文:
Maven, module and JasperReports
问题
以下是翻译好的内容:
尝试通过Eclipse创建图像时(clean javafx:jlink),我遇到了以下错误:
[警告] 检测到基于文件名的必需自动模块。请不要将此项目发布到公共构件存储库!
错误:无法将自动模块与jlink一起使用:来自file:///C:/Users/User/.m2/repository/net/sf/jasperreports/jasperreports/6.12.2/jasperreports-6.12.2.jar的jasperreports
[错误] 命令执行失败。
我的module.info文件:
module my.application {
requires transitive javafx.base;
requires javafx.graphics;
requires javafx.fxml;
requires jasperreports;
exports my.application;
}
我的pom.xml文件:
...
<!-- https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports -->
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>6.12.2</version>
</dependency>
...
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.3</version>
<configuration>
<stripDebug>true</stripDebug>
<compress>2</compress>
<noHeaderFiles>true</noHeaderFiles>
<noManPages>true</noManPages>
<mainClass>my.application.App</mainClass>
<launcher>launcher</launcher>
<jlinkImageName>my-application</jlinkImageName>
</configuration>
</plugin>
我应该如何解决这个问题?我正在使用带有OpenJDK 14的Eclipse IDE 4.15。
英文:
When I try to create an image via Eclipse (clean javafx:jlink) I get this errors:
> [WARNING] Required filename-based automodules detected. Please don't publish this project to a public artifact repository!
>
> Error: automatic module cannot be used with jlink: jasperreports from file:///C:/Users/User/.m2/repository/net/sf/jasperreports/jasperreports/6.12.2/jasperreports-6.12.2.jar
>
> [ERROR] Command execution failed.
My module.info:
module my.application {
requires transitive javafx.base;
requires javafx.graphics;
requires javafx.fxml;
requires jasperreports;
exports my.application;
}
My pom.xml:
...
<!-- https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports -->
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>6.12.2</version>
</dependency>
...
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.3</version>
<configuration>
<stripDebug>true</stripDebug>
<compress>2</compress>
<noHeaderFiles>true</noHeaderFiles>
<noManPages>true</noManPages>
<mainClass>my.application.App</mainClass>
<launcher>launcher</launcher>
<jlinkImageName>my-application</jlinkImageName>
</configuration>
</plugin>
How should I solve this problem? I'm using Eclipse IDE 4.15 with OpenJDK 14.
专注分享java语言的经验与见解,让所有开发者获益!
评论