maven异常处理笔记

来源:互联网 发布:蓝海淘宝客采集软件 编辑:程序博客网 时间:2024/05/18 07:19

1、mvn comile 编译项目的时候报如下错误:

[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!

解决方法:在pom.xml里加入如下配置指定项目编码就不报错了

        <properties>
                 <project.build.sourceEncoding>
                     UTF-8
                 </project.build.sourceEncoding>
        </properties>


2、mvn comile 编译项目的时候如果报找不到maven-compiler-plugin:2.x.x:compile

解决方法是在pom.xml里加入下面配置,电脑上第一次运行maven的时候会报这种错加入配置运行一次把插件jar包下载下来后以后就不会报这种错了

<dependencies>
        <dependency>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
            </dependency>
</dependencies>