命令:
mvn install:install-file
示例:
mvn install:install-file -Dfile=unoil-1.0.jar -DgroupId=com.mycompany -DartifactId=unoil -Dversion=1.0 -Dpackaging=jar
有些小伙伴操作时可能会遇到报错情况The goal you specified requires a project to execute but there is no POM in this directory....,这可能与平台相关,博主在windows也遇到过这种情况,解决方案是给参数加上英文输入法下的双引号
mvn install:install-file "-Dfile=unoil-1.0.jar" "-DgroupId=com.mycompany" "-DartifactId=unoil" "-Dversion=1.0" "-Dpackaging=jar"
注意,等号右侧不要留空格,不然会报错
参数解释:
ArtifactId of the artifact to be installed. Retrieved from POM file if one is specified or extracted from pom.xml in jar if available.
- Type: java.lang.String
- Required<