正如标题所说,我只是想运行 javafx 应用程序。但是我不知道为什么会收到此错误,也不知道为什么错误引用了sisu.inject.bean
andaopalliance
模块。我不知道是 module-info.java 还是 pom.xml 导致了错误。在此先感谢您的任何回答。
模块信息.java:
module ui {
requires javafx.fxml;
requires transitive javafx.graphics;
requires javafx.controls;
requires org.testfx.junit5;
requires junit;
requires core;
exports ui.java;
exports test.ui to junit;
}
pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<groupId>it1901.nachwithme</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ui</artifactId>
<dependencies>
<!-- UI imports core as a dependency -->
<dependency>
<groupId>it1901.nachwithme</groupId>
<artifactId>core</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<!-- Dependencies for javafx -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
</dependency>
<dependency>
<groupId>org.testfx</groupId>
<artifactId>testfx-core</artifactId>
<exclusions>
<exclusion>
<!-- https://mvnrepository.com/artifact/org.sonatype.sisu/sisu-inject-bean -->
<groupId>org.sonatype.sisu</groupId>
<artifactId>sisu-inject-bean</artifactId>
</exclusion>
<exclusion>
<!-- https://mvnrepository.com/artifact/aopalliance/aopalliance -->
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Dependencies for javafx -->
<!-- Dependencies for unit-testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>16-ea+2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.testfx</groupId>
<artifactId>testfx-junit5</artifactId>
<scope>compile</scope>
</dependency>
<!-- Dependencies for unit-testing -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<configuration>
<options>
<!-- <option>dash dash enable-preview</option> -->
</options>
<mainClass>ui.java.App</mainClass>
</configuration>
</plugin>
</plugins>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<includes>
<include>**/*.fxml</include>
<include>**/*.png</include>
</includes>
</resource>
</resources>
<testSourceDirectory>src/test</testSourceDirectory>
<testResources>
<testResource>
<directory>test</directory>
<includes>
<include>**/*.fxml</include>
<include>**/*.png</include>
</includes>
</testResource>
</testResources>
</build>
</project>
错误:
Error occurred during initialization of boot layer
java.lang.module.ResolutionException: Modules sisu.inject.bean and aopalliance export package org.aopalliance.aop to module org.testfx
Process finished with exit code 1