注意加粗加红部分,注意盘符路径用“/”,scope为system
<dependency>
<groupId>com.my</groupId><artifactId>match-api</artifactId>
<version>1.0</version>
<scope>system</scope>
<type>jar</type>
<systemPath>D:/match-api/match-api-1.0.jar</systemPath>
</dependency>
变异的时候要把这个jar包放到war里面需要添加下面的插件和代码
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<warName>${project.artifactId}</warName>
<webResources>
<resource>
<directory>D:/match-api/</directory>
<targetPath>WEB-INF/lib</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>