问题描述
所以我想将 ojdbc 库和 javafx 库捆绑到一个可运行的 jar 文件中。我在设置 pom 文件时遇到问题,因为我对使用这些文件还很陌生。
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>RPSServer</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>RPSServer</name>
<properties>
<maven.compiler.source>10</maven.compiler.source>
<maven.compiler.target>10</maven.compiler.target>
<javafx.version>12</javafx.version>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
<!--<type>jar</type>
<classifier>jar-with-dependencies</classifier>-->
</dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc10</artifactId>
<version>19.10.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<!--<type>maven-plugin</type>-->
<!--<classifier>jar-with-dependencies</classifier>-->
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/assembly/distribution.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
我在设置它时遇到了很多困难。我得到的当前错误是 Unrecognized tag: 'descriptor' (position: START_TAG seen \r\n\t... @2:14)。如果有人能指出我将多个外部库捆绑到一个 jar 文件的方向,这样我就可以在没有任何外部依赖的情况下启动 jar,我将不胜感激。我很确定我的分发文件设置不正确 - 此处仅供参考。
enter code here<assembly>
<descriptor>src/assembly/distribution.xml</descriptor>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)