maven打包成可執行文件

POM 文件中添加spring

 

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>org.imlsz.nettyspringmvc.netty.MyServer</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>assembly</goal>
</goals>
</execution>
</executions>
</plugin>apache

選擇maven項目,右鍵run as ,Maven Install。mvc

控制檯會顯示生成的包的路徑在 target文件夾中生成。app

相關文章
相關標籤/搜索