有时候项目使用到的jar包在maven库里面找不到而存在本地,这时可以直接在pom.xml中将该jar包通过配置加入到项目的依赖中,具体的配置如下:
xml
<dependency> <groupId>group-id</groupId> <artifactId>artifact-id</artifactId> <version>2.0</version> <scope>system</scope> <systemPath>${project.basedir}/src/main/xxx</systemPath> </dependency>
xml
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <configuration> <webResources> <resource> <directory>${project.basedir}/src/main/resources/lib</directory> <targetPath>WEB-INF/lib</targetPath> <filtering>false</filtering> <includes> <include>**/*.jar</include> </includes> </resource> </webResources> </configuration> </plugin>`