如果已经存在一个 pom 并希望将其与 3rd 方工件一起部署,请将pomFile参数设置为 pom.xml 的路径。
mvn deploy:deploy-file -Durl=file:///C:/m2-repo \ -DrepositoryId=some.id \ -Dfile=path-to-your-artifact-jar \ -DpomFile=path-to-your-pom.xml
请注意,groupId、artifactId、版本和打包信息是从给定的 pom 中自动检索的。