java - 使用maven部署javafx hsqldb项目

标签 java maven javafx deployment hsqldb

我做了很多研究,但仍然无法将其部署到我的意思是单个 .jar 文件。 用maven做起来容易吗?我不知道如何将hsqldb添加到maven以及如何从maven获取jar(我只能设置jfx:run作为目标)我的maven 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>org.openjfx</groupId>
    <artifactId>excellkan</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>14</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml</artifactId>
            <version>14</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <release>11</release>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.4</version>
                <configuration>
                    <mainClass>org.openjfx.excellkan.App</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

如果有任何帮助和建议,我将不胜感激。已经谢谢你了。

最佳答案

我从未使用过 Maven,但要将 HSQLDB 添加到其中,请执行以下操作:

<dependency>
    <groupId>org.hsqldb</groupId>
    <artifactId>hsqldb</artifactId>
    <version>2.5.0</version>
</dependency>

here 得到这个.

至于将其部署为.jar,您需要“执行jfx:jar目标”,我看到有人提到了here .

关于java - 使用maven部署javafx hsqldb项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62022127/

相关文章:

java Arrays.binarySearch() 在不区分大小写的搜索中无法找到字符串

gwt - 在客户端使用来自 GWT 中另一个 Maven 模块的 java 对象

java - 无法更改标签和按钮值

java - 如何使用哈希标记显示文档

JavaFX打印自定义纸张尺寸

java - 在java中捕获javascript返回值

java - Android 按钮点击崩溃应用程序

Java 对象到 JSON 的转换

java - 如何更改 hpi :run 的端口号

android - "ndk-build finish with non-zero exit value 2"编译 textfairy 项目时