JavaFX使用maven-shade-plugin打成Jar包

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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0modelVersion>

    <groupId>groupIdgroupId>
    <artifactId>fx-demo-2artifactId>
    <version>1.0-SNAPSHOTversion>

    
    <dependencies>
        <dependency>
            <groupId>com.alibabagroupId>
            <artifactId>fastjsonartifactId>
            <version>1.2.72version>
        dependency>

    dependencies>

    
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.pluginsgroupId>
                <artifactId>maven-shade-pluginartifactId>
                <version>2.4.3version>

                <configuration>
                    <transformers>
                        <transformer
                                implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                            <mainClass>sample.MainmainClass>
                        transformer>
                    transformers>
                configuration>

                <executions>
                    <execution>
                        <phase>packagephase>
                        <goals>
                            <goal>shadegoal>
                        goals>
                    execution>
                executions>
            plugin>

        plugins>
    build>

project>

打包结果解压查看
JavaFX使用maven-shade-plugin打成Jar包_第1张图片

你可能感兴趣的:(JavaFX使用maven-shade-plugin打成Jar包)