We are Borg
We are Borg

Reputation: 5313

Javafx : Is this javafx-maven plugin configuration correct?

I am working on a JavaFX application on Intellij Idea using JDK8, and I am using Maven for that. As I looked upon net, I came up with the Javafx-maven plugin on zenjava.com. I was already using Maven in the JavaFX project without the plugin. So my question is, why do we need the javafx-maven plugin by zenjava guys and is my configuration correct.

I have added the plugin dependency, but removing it is not effecting anything. So I fail to understand the point of it.

Here's my 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>GroupIDNAME</groupId>
    <artifactId>Artifactidname</artifactId>
    <version>1.0-SNAPSHOT</version>
    <properties>
        <org.slf4j-version>1.7.5</org.slf4j-version>
        <java-version>1.8</java-version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>
    <dependencies>

        <dependency>
            <groupId>com.zenjava</groupId>
            <artifactId>javafx-maven-plugin</artifactId>
            <version>8.1.2</version>
        </dependency>

        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-asl</artifactId>
            <version>1.9.13</version>
        </dependency>

        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.3.1</version>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>[18.0,)</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>4.1.4.RELEASE</version>
        </dependency>


        <!-- Logging dependencies -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${org.slf4j-version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>${org.slf4j-version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${org.slf4j-version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.15</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.jms</groupId>
                    <artifactId>jms</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jdmk</groupId>
                    <artifactId>jmxtools</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jmx</groupId>
                    <artifactId>jmxri</artifactId>
                </exclusion>
            </exclusions>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.2</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <compilerArgument>-Xlint:all</compilerArgument>
                    <showWarnings>false</showWarnings>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

Kindly let me know. Thanks a lot.

Upvotes: 0

Views: 1342

Answers (1)

FibreFoX
FibreFoX

Reputation: 2858

I'm the maintainer of the javafx-maven-plugin.

The MAVEN-plugin is internally using the official tooling from oracle. Normal javapackager is called via ANT, which isn't the favorite tooling for maven-projects.

Adding the maven-plugin inside your dependency-tree isn't solving anything, it is intended to use it as build-plugin.

The plugin takes care of filling all required settings and creating the wanted native bundle.

There exists one maven-archetype you can try out for yourself: https://github.com/javafx-maven-plugin/javafx-basic-archetype

Upvotes: 2

Related Questions