码迷,mamicode.com
首页 > 编程语言 > 详细

maven 打包java项目(含web工程)指定Main类

时间:2020-01-08 16:06:05      阅读:104      评论:0      收藏:0      [点我收藏+]

标签:app   project   tor   efs   文件   lse   maven 打包   config   esc   

<!-- 这里只是build 部分 -->
<build>
<!-- 制定配置文件的位置 -->
<resources>
<resource>
<targetPath>${project.build.directory}/classes</targetPath>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<!-- <include>*/.xml</include> -->
<include>*.properties</include>
</includes>
</resource>
<resource>
<targetPath>${project.build.directory}/classes/META-INF/spring</targetPath>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>dubbo-provider.xml</include>
</includes>
</resource>
</resources>
<!-- 将所有依赖都打包到目的jar下 -->
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.alibaba.dubbo.container.Main</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>assembly</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

maven 打包java项目(含web工程)指定Main类

标签:app   project   tor   efs   文件   lse   maven 打包   config   esc   

原文地址:https://blog.51cto.com/13801457/2465150

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!