everyone!
I've tried to create .jar
file by Maven with dependence on JavaFX according to this post. Unfortunately, attempts was failed. In folder targets
creating two files:
- MAVEN_UI_INTRO-1.0-SNAPSHOT.jar
- original-MAVEN_UI_INTRO-1.0-SNAPSHOT.jar
With first file, I get this error:
Error: JavaFX runtime components are missing, and are required to run this application
With second file, this error:no main manifest attribute, in target/original-MAVEN_UI_INTRO-1.0-SNAPSHOT.jar
Build by command mvn clean package
Start by command java -jar target/"someJarFile.jar"
Main question: What do I wrong?
UPD: My pom.xml file:
<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>com.novalab</groupId>
<artifactId>MAVEN_UI_INTRO</artifactId>
<version>1.0-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>11.0.2</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>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.novalab.App</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.1</version>
<configuration>
<mainClass>com.novalab.App</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>