java - 未能执行目标 org.openjfx:javafx-maven-plugin 默认 cli
问题描述
我正在使用 javafx 在 intellij 中开发一个项目,执行时出现此错误:无法在项目 uebung11 上执行目标 org.openjfx:javafx-maven-plugin:0.0.1:run (default-cli):错误
这是我的pom 文件:
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>hbgm.spengergasse</groupId>
<artifactId>uebung11</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>12</maven.compiler.source>
<maven.compiler.target>12</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-base</artifactId>
<version>12</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>12</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>12</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
<version>12</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>12</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.1</version>
<configuration>
<mainClass>uebung11.hbgm.spengergasse.App</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
应用程序。爪哇
/** * JavaFX App */ public class App extends Application {
private static Scene scene;
public App() throws IOException {
}
@Override
public void start(Stage stage) throws IOException {
scene = new Scene(loadFXML("primary"));
stage.setScene(scene);
stage.show();
}
static void setRoot(String fxml) throws IOException {
scene.setRoot(loadFXML(fxml));
}
private static Parent loadFXML(String fxml) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml"));
return fxmlLoader.load();
}
Parent root = FXMLLoader.load(getClass().getResource("/sample.fxml"));
public static void main(String[] args) {
launch();
}
}
我已经搜索了解决方案并阅读了所有已经发布的问题,但我无法解决这个问题,所以如果你能帮助我,我会很高兴。
解决方案
推荐阅读
- python-3.x - 如何从给定登录日期之前过去发生的 timedelta 值中获取确切日期?
- r - 如何删除观星者中的引文?
- mongodb - 通过 Annotation 在 Spring Data 中使用默认语言为 mongodb 定义通配符文本索引
- python - 将文本中的元素添加到字典
- mysql - 在 3 个表中使用 join 查询 knex
- javascript - 为什么将 SVG 图像导入到 Icon 对象时不显示?
- swift - 选择更改时,通过 NSViewRepresentable 将值从 NSTextView 传递到父 SwiftUI 视图
- excel - 如何在不同的 Excel 工作表中运行宏?它没有循环
- asp.net-core - 使用 EF .net 5 在 ASP.NET Core 中使用迷你探查器出现“未找到”错误
- algorithm - 计算 a[i] 最右边或最左边且最大的段