打包命令
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
常見錯誤
maven目錄裏的setting.xml文件中
<!--
<localRepository>/java/maven/apache-maven-3.6.3/properties</localRepository>
-->
<!-- 一般idea使用的本地倉庫地址 -->
<localRepository>/Users/mac/.m2/repository</localRepository>
上傳成功
在pom.xml文件中按照格式添加依賴就可以了
<dependency>
<groupId>org.selenium</groupId>
<artifactId>selenium-server-standalone</artifactId>
<version>3.9.1</version>
</dependency>