1.正确命令如下(不能多空格)
mvn install:install-file -Dfile=完整的jar包目录(.jar) -DgroupId=com.** -DartifactId=db-test(个人名称) -Dversion=版本号 -Dpackaging=jar -Dmaven.repo.local=仓库目录(可不加则默认)
2.Since Maven http repositories are blocked:
原因:
maven在3.8.1 的默认配置文件中增加了一组标签,如果仓库镜像是 http 而不是https 就会被拦截禁止访问,而当前公司私服一般是http 而不支持https。
解决:
settings中添加配置项
<mirrors>
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>maven-default-http-blocker</id>
<mirrorOf>external:http:*</mirrorOf>
<name>Pseudo repository to mirror external repositories initially using HTTP.</name>
<url>http://0.0.0.0/</url>
<blocked>true</blocked>
</mirror>
</mirrors>
3. Unknown lifecycle phase " " You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>
也就是说了一堆格式错误,其实并没有,因为我是在项目目录中执行的
解决:
换一个空目录去执行即可