- 使用管理员权限 打开一个 cmd 窗口
- 输入 mvn -v 查看 maven 版本
- 由于之前 并没有这样的操作所以第一次 执行的时候 提示 命令不存在
- 所以需要将 maven 软件中的 bin 文件的目录 添加到 环境变量中 的 path 变量 中
- 本机路径为:D:\Program Files (x86)\apache-maven-3.5.2\bin
powershell
C:\Users\Administrator\Desktop\ArcSoftFace\ArcSoftFaceDemo\lib>path
PATH=D:\Program Files\Git\usr\bin;D:\Program Files (x86)\netspy;D:\Program Files (x86)\Aopo\bin;C:\Program Files\Java\jdk1.8.0_221\bin;D:\Program Files (x86)\VMware\VMware Workstation\bin\;D:\cygwin64\bin;D:\Program Files\MySQL\MySQL Server 5.5\bin;C:\windows\system32;C:\windows;D:\Program Files (x86)\smsboom;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;D:\Program Files\Git\cmd;D:\Program Files\Git\bin;D:\Program Files (x86)\NetSarang\Xshell 7\;D:\Program Files (x86)\NetSarang\Xftp 7\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;D:\Program Files\opencv\build\x64\vc15\bin;D:\Program Files (x86)\cmake-3.9.4-win64-x64\bin;D:\Program Files (x86)\Dev-Cpp\MinGW64\bin;D:\Python\Python37\Scripts;D:\Program Files\aircrack-ng-1.6-win\bin;D:\Program Files\aircrack-ng-1.6-win\bin;D:\Program Files\Cracer安全工具包v7\Nmap;D:\Program Files (x86)\Tencent\微信web开发者工具\dll;D:\Program Files\nodejs\;D:\Program Files (x86)\apache-maven-3.5.2\bin;D:\Python\Python37\Scripts\;D:\Python\Python37\;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;E:\Nodejs_ku\node_global;D:\Microsoft VS Code\bin;D:\mingw64\bin;D:\Program Files\JetBrains\IntelliJ IDEA 2022.1.1\bin;;D:\Program Files\Bandizip\;D:\Program Files\Cracer安全工具包v7\Nmap;D:\Program Files (x86)\Nmap;D:\Program Files\JetBrains\GoLand 2022.1\bin;;D:\Program Files\JetBrains\PyCharm 2022.1\bin;;D:\Program Files\JetBrains\WebStorm 2022.1.4\bin;;C:\Users\Administrator\AppData\Roaming\npm
powershell
C:\Users\Administrator\Desktop\ArcSoftFace\ArcSoftFaceDemo\lib>mvn -v
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T15:58:13+08:00)
Maven home: D:\Program Files (x86)\apache-maven-3.5.2\bin\..
Java version: 1.8.0_221, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_221\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
-
要把 人脸识别的 sdk 安装到 本地的 maven 仓库中 需要在这个jar 包的 根目录下 执行
mvn install:install-file -DgroupId=com.codervibe -DartifactId=arcsoftsdk -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=arcsoft-sdk-face-3.0.0.0.jar
-
-DgroupId 为 maven 依赖的 groupId
-
-DartifactId 为 maven 依赖的 artifactId
-
-Dversion 为 maven 依赖的 version
-
-Dfile 为 要安装的 jar 包的 文件名
powershell
C:\Users\Administrator\Desktop\ArcSoftFace\ArcSoftFaceDemo\lib>mvn install:install-file -DgroupId=com.codervibe -DartifactId=arcsoftsdk -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=arcsoft-sdk-face-3.0.0.0.jar
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom ---
[INFO] Installing C:\Users\Administrator\Desktop\ArcSoftFace\ArcSoftFaceDemo\lib\arcsoft-sdk-face-3.0.0.0.jar to E:\maven\maven_repository\com\codervibe\arcsoftsdk\1.0-SNAPSHOT\arcsoftsdk-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.164 s
[INFO] Finished at: 2022-08-26T22:24:13+08:00
[INFO] Final Memory: 6M/184M
[INFO] ------------------------------------------------------------------------
C:\Users\Administrator\Desktop\ArcSoftFace\ArcSoftFaceDemo\lib>
- 在pom.xml 中添加 即可使用
xml
<dependency>
<groupId>com.codervibe</groupId>
<artifactId>arcsoftsdk</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>