0

So I want to bundle the ojdbc library and the javafx library into a runnable jar file. I am having trouble setting up the pom file since I am fairly new to using these files.

<?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>

I am having a lot of difficulty setting this up. The current error I am getting is Unrecognised tag: 'descriptor' (position: START_TAG seen \r\n\t... @2:14). If someone could point me in the direction of bundling multiple external libraries into a jar file so I can just boot up the jar without any external dependencies I would really appreciate it. I'm pretty sure my distribution file is not set up correctly- here it is for reference.

enter code here<assembly>
<descriptor>src/assembly/distribution.xml</descriptor>
  • 1
    Please try https://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven – Saurabh Singh Jun 04 '21 at 14:18

0 Answers0