第一个是用户javafx的javafx-maven-plugin插件,不仅能打包jar还能打包成native(exe格式)
<plugin> <groupId>com.zenjava</groupId> <artifactId>javafx-maven-plugin</artifactId> <version>8.8.3</version> <configuration> <mainClass>com.deskmedia.Main</mainClass> <vendor>DeskMedia</vendor> </configuration> </plugin>
第二个是maven-assembly-plugin,它能将lib打包进jar中
<plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>com.deskmedia.Main</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin>
发表回复