在pom.xml里增加如下配置
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.2.0</version> <configuration> <webResources> <resource> <directory>${project.basedir}/lib</directory> <targetPath>WEB-INF/lib</targetPath> <filtering>false</filtering> </resource> </webResources> </configuration> </plugin>
<dependency> <groupId>com.baidu.bcs</groupId> <artifactId>baidu-sdk</artifactId> <version>1.4.5</version> <scope>system</scope> <systemPath>${project.basedir}/lib/baidu-sdk-1.4.5.jar</systemPath> </dependency>scope,systemPath增加上
本文介绍如何在Maven项目中配置特定依赖项,并将其正确包含在最终的WAR文件中。通过在pom.xml文件中添加相应的插件配置和依赖定义,可以确保自定义库被正确打包并部署。
1032

被折叠的 条评论
为什么被折叠?



