打包命令

mvn install:install-file -Dfile=/Users/用户名/tool/selenium-server-standalone-3.9.1.jar -DgroupId=org.selenium -DartifactId=selenium-server-standalone -Dversion=3.9.1 -Dpackaging=jar

注意:
如果没有配置全局环境变量,请找到你maven文件夹,在文件夹的bin目录中进行命令。


-Dfile -> jar包的路径
-DgroupId -> 对应maven依赖中的groupId
-Dversion -> 对应maven依赖中的Dversion,版本号
-DartifactId -> 对应maven依赖中的DartifactId

常见错误

Mac系统用Maven本地引入jar包报错问题解决_xml文件

maven目录里的setting.xml文件中节点的地址和你本地仓库地址不匹配

<!--
<localRepository>/java/maven/apache-maven-3.6.3/properties</localRepository>
-->

<!-- 一般idea使用的本地仓库地址 -->
<localRepository>/Users/mac/.m2/repository</localRepository>

Mac系统用Maven本地引入jar包报错问题解决_xml文件_02

上传成功

Mac系统用Maven本地引入jar包报错问题解决_xml文件_03

在pom.xml文件中按照格式添加依赖就可以了

<dependency>
<groupId>org.selenium</groupId>
<artifactId>selenium-server-standalone</artifactId>
<version>3.9.1</version>
</dependency>

优秀不够,你是否无可替代

软件测试交流QQ群:721256703,期待你的加入!!

欢迎关注我的微信公众号:软件测试君

Mac系统用Maven本地引入jar包报错问题解决_maven_04