最近被mvn烦的不行,还查阅不到有用的解决信息,打算汇总一下。
1.maven打包编译时后台一直输出警告信息
[WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!
在pom.xml文件中增加一个配置项即可
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
2. [Error]No goals have been specified for this build. You must specify a valid li
fecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id
>:<plugin-artifact-id>[:<plugin-version>]:<goal>.
解决:
在pom.xml文件<build>标签后面加上
<defaultGoal>compile</defaultGoal>
即可。
3.mvn 配置指定本地仓库
mvn--conf--setting.xml中:加上:
<localRepository>F:\Apache\apache-maven-3.5.4\repository</localRepository>
4.配置阿里云镜像库
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<mirrorOf>central</mirrorOf>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>