簡體   English   中英

使用javafx-maven-plugin部署javafx時出錯

[英]Error during deployment of javafx with javafx-maven-plugin

這是我的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>

這是我的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>

使用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.

並且在運行生成的exe時出現錯誤調用方法,並且無法啟動jvm 我正在使用jdk 1.8u60。 請任何幫助,預先感謝...

您發布的“錯誤”沒有錯誤。 這些警告僅表示存在一個Main-class,但沒有一個用於運行javafx-application的匹配類。 這來自使用過的javapackager ,沒有問題。

關於“ JVM”,您可能要在maven項目本身上創建一個問題。

免責聲明:我是javafx-maven-plugin的維護者。 如果確實是一個Bug(包括可以復制該項目的項目),則可以自由地在該項目上打開問題,而不是使用stackoverflow。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM