idea springboot maven 打包jar 包含本地jar

如果需要在打包的时候依赖本地jar,需要修改增加如下配置:

<plugin>
    <groupId>org.apache.maven.pluginsgroupId>
    <artifactId>maven-compiler-pluginartifactId>
    <configuration>
        <source>1.8source>
        <target>1.8target>
        <encoding>UTF-8encoding>
        
            ${project.basedir}/libs
        
    configuration>
plugin>

如果使用的maven版本高于3.1,上述配置已被废弃,需要做如下修改:

<plugin>
    <groupId>org.apache.maven.pluginsgroupId>
    <artifactId>maven-compiler-pluginartifactId>
    <configuration>
        <source>1.8source>
        <target>1.8target>
        <encoding>UTF-8encoding>
         
            -extdirs 
            ${project.basedir}/libs
         
    configuration>
plugin>


然后加上:

   
              
                ${project.basedir}/libs  
                BOOT-INF/lib/  
                  
                    **/*.jar  
                  
              
          

完整的是:

	
		
			
			org.apache.maven.plugins
			maven-compiler-plugin
			
				1.8
				1.8
				UTF-8
				 
					-extdirs 
					${project.basedir}/libs
				 
			
			
	

	  
              
                ${project.basedir}/libs  
                BOOT-INF/lib/  
                  
                    **/*.jar  
                  
              
         

	



你可能感兴趣的:(maven,package)