maven 打包java项目(含web工程)指定Main类
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了maven 打包java项目(含web工程)指定Main类相关的知识,希望对你有一定的参考价值。
<!-- 这里只是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类的主要内容,如果未能解决你的问题,请参考以下文章