1 回答

TA貢獻1827條經驗 獲得超4個贊
在 maven 項目中,所有依賴項都由 pom.xml 處理。我們可以使用 maven 存儲庫來下載依賴項,也可以從本地目錄添加它。以下可以將 jar 安裝到本地 maven 存儲庫。
參考資料: http ://maven.apache.org/general.html#importing-jars https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
mvn install:install-file
-Dfile=<path-to-file>
-DgroupId=<group-id>
-DartifactId=<artifact-id>
-Dversion=<version>
-Dpackaging=<packaging>
-DgeneratePom=true
Where: <path-to-file> the path to the file to load
<group-id> the group that the file should be registered under
<artifact-id> the artifact name for the file
<version> the version of the file
<packaging> the packaging of the file e.g. jar
添加回答
舉報