springboot 打jar包,配置文件在 jar包外面,的 pom. xml 配置, 修改配置文件,不需要重新打jar包

mvn clean package -Dmaven.test.skip=true -Plinux_prod

<build>

    <finalName>xxxfinalName>

    <plugins>

        <plugin>

            <groupId>org.apache.maven.pluginsgroupId>

            <artifactId>maven-war-pluginartifactId>

            <version>2.2version>

            <configuration>

                <failOnMissingWebXml>falsefailOnMissingWebXml>

                <overlays>

                    <overlay>

                        <groupId>com.hjzgroupId>

                        <artifactId>casartifactId>

                        <excludes>

                            <exclude>WEB-INF/libexclude>

                        excludes>

                    overlay>

                overlays>

            configuration>

        plugin>

        <plugin>

            <groupId>org.apache.maven.pluginsgroupId>

            <artifactId>maven-compiler-pluginartifactId>

            <version>3.6.1version>

            <configuration>

                <source>1.8source>

                <target>1.8target>

                <encoding>UTF-8encoding>

                <compilerArguments>

                    <extdirs>${project.basedir}/src/main/webapp/WEB-INF/libextdirs>

                compilerArguments>

            configuration>

        plugin>

    plugins>build>

 

 

 

 

 

 

 

 

 

<plugins>

<plugin>

<groupId>org.springframework.bootgroupId>

<artifactId>spring-boot-maven-pluginartifactId>

<configuration>

<executable>trueexecutable>

configuration>

plugin>

<plugin>

<groupId>org.apache.maven.pluginsgroupId>

<artifactId>maven-jar-pluginartifactId>

<configuration>

<excludes>

<exclude>*.propertiesexclude>

<exclude>*.ymlexclude>

excludes>

<archive>

<manifestEntries>

<Class-Path>conf/Class-Path>

manifestEntries>

archive>

configuration>

plugin>

<plugin>

<artifactId>maven-resources-pluginartifactId>

<executions>

<execution>

<id>copy-xmlsid>

<phase>process-sourcesphase>

<goals>

<goal>copy-resourcesgoal>

goals>

<configuration>

<outputDirectory>${basedir}/target/confoutputDirectory>

<resources>

<resource>

<directory>${basedir}/src/main/resourcesdirectory>

<includes>

<include>*/*include>

<include>*include>

<exclude>ChangeLog.mdexclude>

includes>

resource>

resources>

configuration>

execution>

executions>

plugin>

<plugin>

<artifactId>maven-compiler-pluginartifactId>

<version>2.3.2version>

<configuration>

<source>1.8source>

<target>1.8target>

<encoding>UTF-8encoding>

<compilerArguments>

<extdirs>libextdirs>

compilerArguments>

configuration>

plugin>

plugins>

 

 

  1. <build>       
  2.      
  3.          
  4.         org.apache.maven.plugins     
  5.         maven-war-plugin     
  6.         2.1.1     
  7.                
  8.               WebContent\WEB-INF\web.xml                
  9.              
  10.          
  11.      
  12.   

 

 

 

 

  1. <build>  
  2.           
  3.               
  4.                 org.apache.maven.plugins  
  5.                 maven-war-plugin  
  6.                 2.1.1  
  7.                   
  8.                           
  9.                     WebRoot\WEB-INF\web.xml  
  10.                       
  11.                     WebRoot  
  12.                   
  13.               
  14.           
  15.       

分隔符

<build>

<plugins>

<plugin>

<groupId>org.mybatis.generatorgroupId>

<artifactId>mybatis-generator-maven-pluginartifactId>

<version>1.3.2version>

<configuration>

<verbose>trueverbose>

<overwrite>trueoverwrite>

configuration>

plugin>

<plugin>

<groupId>org.apache.maven.pluginsgroupId>

<artifactId>maven-compiler-pluginartifactId>

<version>3.6.1version>

<configuration>

<source>1.8source>

<target>1.8target>

<encoding>UTF-8encoding>

<compilerArgs>

<arg>-extdirsarg>

<arg>${project.basedir}/libarg>

compilerArgs>

configuration>

plugin>

 

 

<plugin>

<groupId>org.apache.maven.pluginsgroupId>

<artifactId>maven-war-pluginartifactId>

<version>2.1.1version>

<configuration>

<webXml>web\WEB-INF\web.xmlwebXml>

<warSourceDirectory>webwarSourceDirectory>

<webResources>

<resource>

<directory>lib/directory>

<targetPath>WEB-INF/libtargetPath>

<includes>

<include>**/*.jarinclude>

includes>

resource>

webResources>

configuration>

plugin>

plugins>

 

 

<resources>

<resource>

<directory>src/main/javadirectory>

<includes>

<include>**/*.xmlinclude>

includes>

resource>

<resource>

<directory>src/main/resourcesdirectory>

<includes>

<include>*include>

<include>*/*include>

includes>

resource>

resources>

build>

 

springboot 打jar包,配置文件在 jar包外面,的 pom. xml 配置, 修改配置文件,不需要重新打jar包_第1张图片

 

 springboot 打jar包,配置文件在 jar包外面,的 pom. xml 配置, 修改配置文件,不需要重新打jar包_第2张图片

 

 

 

 

 

 springboot 打jar包,配置文件在 jar包外面,的 pom. xml 配置, 修改配置文件,不需要重新打jar包_第3张图片

 

 

 springboot 打jar包,配置文件在 jar包外面,的 pom. xml 配置, 修改配置文件,不需要重新打jar包_第4张图片

 

 

 

 

 

 


       
           
                org.springframework.boot
                spring-boot-maven-plugin
           

           
                org.apache.maven.plugins
                maven-jar-plugin
               
                   
                       
                            true
                           
                            com.cn.Application
                       

                   

               

           

           
                org.apache.maven.plugins
                maven-assembly-plugin
               
               
                   
                   
                        src/main/assembly/package.xml
                   

               

               
                   
                        make-assembly
                        package
                       
                            single
                       

                   

               

           

       

       
           
                src/main/java
               
                    **/*.xml
               

                false
           

           
                src/main/resources
           

           
                lib/
                lib
               
                    **/*.jar
               

           

       

你可能感兴趣的:(springboot 打jar包,配置文件在 jar包外面,的 pom. xml 配置, 修改配置文件,不需要重新打jar包)