使用maven搭建工程时,可能会使用第三方包。
可使用如下方法:
在cmd中输入:
mvn install:install-file -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dclassifier=template -Dpackaging=jar -Dfile=<path-to-file>
说明:-Dfile指第三方jar的路径,其它的注意要确保maven命令中groupId、artifactId、version与pom.xml中的配置相同,-Dpackaging表示加载的文件类型
例如:
mvn install:install-file -DgroupId=com.ant -DartifactId=GetApkInfo -Dversion=1.0 -Dclassifier=template -Dpackaging=jar -Dfile=E:/Downloads/package/GetApkInfo.jar
则在pom.xml中
<dependency>
<groupId>com.ant</groupId>
<artifactId>GetApkInfo</artifactId>
<version>1.0</version>
<classifier>template</classifier>
</dependency>