带有CDI,JPA和javafx-maven-plugin的JavaFX

时间:2014-03-03 15:28:54

标签: java maven javafx

我使用mvn jfx:run构建并运行我的应用程序,但我想将CDI添加到其中。现在运行它以Missing beans.xml file in META-INF!

结束

有没有办法让它将文件从META-INF添加到jar? 或者也许有另一种用maven构建javafx应用程序的方法(没有antrun)?

这是我的pom.xml

<?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>pl.arenatd</groupId>
<artifactId>ArenaTD_Manager</artifactId>
<name>ArenaTD_Manager</name>

<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>

<organization>
    <!-- Used as the 'Vendor' for JNLP generation -->
    <name>arenatd</name>
</organization>

<properties>
    <slf4j.version>1.6.1</slf4j.version>
</properties>

<build>

    <finalName>ArenaTD_Manager</finalName>

    <plugins>

        <plugin>
            <groupId>com.zenjava</groupId>
            <artifactId>javafx-maven-plugin</artifactId>
            <version>2.0</version>
            <configuration>
                <mainClass>pl.arenatd.manager.MainApp</mainClass>
            </configuration>
        </plugin>

    </plugins>
</build>


<dependencies>

    <!-- Apache Commons -->

    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.6</version>
    </dependency>

    <!-- Logging  -->

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${slf4j.version}</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.16</version>
    </dependency>

    <!-- JPA -->
    <dependency>
        <groupId>org.hibernate.javax.persistence</groupId>
        <artifactId>hibernate-jpa-2.0-api</artifactId>
        <version>1.0.1.Final</version>
    </dependency>

    <!-- CDI -->
    <dependency>
        <groupId>javax.enterprise</groupId>
        <artifactId>cdi-api</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>org.jboss.weld</groupId>
        <artifactId>weld-core</artifactId>
        <version>2.1.2.Final</version>
    </dependency>
    <dependency>
        <groupId>org.jboss.weld.se</groupId>
        <artifactId>weld-se</artifactId>
        <version>2.1.0.Final</version>
    </dependency>

</dependencies>

</project>

1 个答案:

答案 0 :(得分:2)

尝试将正确的beans.xml文件添加到src / main / resources / META-INF