Here is my pom.xml
<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.qaf</groupId>
<artifactId>bgos</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>BGOS</name>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- JPA -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.3.6.Final</version>
</dependency>
<!-- For connection pooling -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>4.3.6.Final</version>
</dependency>
<!-- Database -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.36</version>
</dependency>
<dependency>
<groupId>com.airhacks</groupId>
<artifactId>afterburner.fx</artifactId>
<version>1.5.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.controlsfx</groupId>
<artifactId>controlsfx</artifactId>
<version>8.40.10</version>
<type>jar</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<excludes>
<exclude>junit:junit</exclude>
</excludes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>test-app</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bin/java</executable>
<arguments>
<argument>-Djavafx.verbose=true</argument>
<argument>-cp</argument>
<argument>./target/test-app.jar</argument>
<argument>com.qaf.App</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.5.0</version>
<configuration>
<vendor>QAF</vendor>
<mainClass>com.qaf.App</mainClass>
<verbose>true</verbose>
<appName>BGOS</appName>
<bundleArguments>
<jnlp.includeDT>true</jnlp.includeDT>
<jnlp.outfile>BGOS</jnlp.outfile>
</bundleArguments>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.fxml</include>
<include>**/*.css</include>
<include>**/*.png</include>
<include>**/*.jpg</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
<finalName>BGOS</finalName>
</build>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
And here is my persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="adara" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>com.qaf.model.entity.Stamp</class>
<class>com.qaf.model.entity.Income</class>
<class>com.qaf.model.entity.Returns</class>
<class>com.qaf.model.entity.Expenses</class>
<properties>
<!-- Configuring JDBC properties -->
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/workshopdb"/>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="javax.persistence.jdbc.user" value="root"/>
<property name="javax.persistence.jdbc.password" value="abcd"/>
<!-- Hibernate properties -->
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
<property name="hibernate.hbm2ddl.auto" value=" update"/>
<!-- Configuring Connection Pool -->
<property name="hibernate.c3p0.min_size" value="5"/>
<property name="hibernate.c3p0.max_size" value="20"/>
<property name="hibernate.c3p0.timeout" value="500"/>
<property name="hibernate.c3p0.max_statements" value="50"/>
<property name="hibernate.c3p0.idle_test_period" value="2000"/>
</properties>
</persistence-unit>
</persistence>
While using mvn jfx:native
to create a native builder i am getting the following error...
The jar lib\hibernate-commons-annotations-4.0.5.Final.jar has a main class org.hibernate.annotations.common.Version that does not match the declared main com.qaf.App
The jar lib\javassist-3.18.1-GA.jar has a main class javassist.CtClass that does not match the declared main com.qaf.App
The jar lib\hibernate-core-4.3.6.Final.jar has a main class org.hibernate.Version that does not match the declared main com.qaf.App
[INFO] Applying workaround for oracle-jdk-bug since 1.8.0u60 regarding jar-path inside generated JNLP-files.
and while running the generated exe getting error invoking method and Failed to launch jvm . I am using jdk 1.8u60. Any help please,, Thanks in advance...
The "error" you have posted is no error. These warnings only say that there is a Main-class, but not the matching one which is used for your javafx-application to run. This comes from the used javapackager
and is no problem.
Regarding the "JVM"-thing, you might want to create an issue on the maven-project itself.
Disclaimer: I'm the maintainer of the javafx-maven-plugin. Instead of stackoverflow you are free to open an issue on that project, in case this really is a bug, including a project where this can be reproduced.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.