springboot 多模块 打war包 打jar包

根pom.xml 插件配置

<
plugin> <groupId>org.apache.maven.pluginsgroupId> <artifactId>maven-compiler-pluginartifactId> <version>3.7.0version> <configuration> <source>${java.version}source> <target>${java.version}target> <encoding>${project.build.sourceEncoding}encoding> configuration> plugin>

 

1. 打war包

有主类的pom.xml

<packaging>warpackaging>
<build>
        <finalName>你最后希望打包生成的名字finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.bootgroupId>
                <artifactId>spring-boot-maven-pluginartifactId>
                <version>2.1.3.RELEASEversion>
                <configuration>
            plugin>

            <plugin>
                <groupId>org.apache.maven.pluginsgroupId>
                <artifactId>maven-war-pluginartifactId>
                <version>3.0.0version>
                <configuration>
                    <failOnMissingWebXml>falsefailOnMissingWebXml>
                    <warName>${artifactId}warName>
                configuration>
            plugin>
        plugins>
build>

 

2. 打jar包

有主类的pom.xml

<packaging>warpackaging>
<build>
        <finalName>你最后希望的名字finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.bootgroupId>
                <artifactId>spring-boot-maven-pluginartifactId>
                <version>2.1.3.RELEASEversion>
                <configuration>
                    <mainClass>com.xxx.xxx.xxxApplicationmainClass>
                configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackagegoal>
                        goals>
                    execution>
                executions>
            plugin>
        plugins>
build>

 

你可能感兴趣的:(springboot 多模块 打war包 打jar包)