[英]Error during deployment of javafx with javafx-maven-plugin
Here is my pom.xml 这是我的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 这是我的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... 使用mvn jfx:native
创建本机生成器时,出现以下错误...
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 . 并且在运行生成的exe时出现错误调用方法,并且无法启动jvm 。 I am using jdk 1.8u60. 我正在使用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. 这些警告仅表示存在一个Main-class,但没有一个用于运行javafx-application的匹配类。 This comes from the used javapackager
and is no problem. 这来自使用过的javapackager
,没有问题。
Regarding the "JVM"-thing, you might want to create an issue on the maven-project itself. 关于“ JVM”,您可能要在maven项目本身上创建一个问题。
Disclaimer: I'm the maintainer of the javafx-maven-plugin. 免责声明:我是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. 如果确实是一个Bug(包括可以复制该项目的项目),则可以自由地在该项目上打开问题,而不是使用stackoverflow。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.