将本地jar导入war中

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/heting717/article/details/82227362
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerVersion>1.7</compilerVersion>
                    <source>1.7</source>
                    <target>1.7</target>
                    <encoding>UTF-8</encoding>
                    <compilerArgs>
                        <arg>-extdirs</arg>
                        <arg>${project.basedir}/lib</arg>
                    </compilerArgs>
                </configuration>
            </plugin>

            <!--本地jar包 打进war包-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <webResources>
                        <resource>
                            <directory>${project.basedir}/lib</directory>
                            <targetPath>WEB-INF/lib</targetPath>
                            <includes>
                                <include>**/*.jar</include>
                            </includes>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>

pom.xml中加入以上代码,因为我的项目中有对spring-boot-starter-parent的依赖,所以在配置maven-war-plugin的时候要注意。

猜你喜欢

转载自blog.csdn.net/heting717/article/details/82227362