直接使用yum install maven安装的可能不是最新版本,比如CentOS7很可能就装的是maven3.1。在使用某些插件时就会出错。
    安装最新版本用如下方法:

    1. wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
    2. yum install apache-maven

    先使用yum remove maven之后再安装,可能会遇到包冲突。此时需要先用yum卸载相关包,再安装即可。

    IDEA需要配置settings.xml。
    外置的Maven需要修改安装文件conf下得settings.xml。

    1. <mirror>
    2. <id>alimaven</id>
    3. <name>aliyun maven</name>
    4. <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    5. <mirrorOf>central</mirrorOf>
    6. </mirror>
    7. <mirror>
    8. <id>ui</id>
    9. <mirrorOf>central</mirrorOf>
    10. <name>Human Readable Name for this Mirror.</name>
    11. <url>http://uk.maven.org/maven2/</url>
    12. </mirror>
    13. <mirror>
    14. <id>jboss-public-repository-group</id>
    15. <mirrorOf>central</mirrorOf>
    16. <name>JBoss Public Repository Group</name>
    17. <url>http://repository.jboss.org/nexus/content/groups/public</url>
    18. </mirror>
    19. <mirror>
    20. <id>repo2</id>
    21. <mirrorOf>central</mirrorOf>
    22. <name>Human Readable Name for this Mirror.</name>
    23. <url>http://repo2.maven.org/maven2/</url>
    24. </mirror>
    25. <mirror>
    26. <id>OSChina</id>
    27. <name>OSChina Central</name>
    28. <url>http://maven.oschina.net/content/groups/public/</url>
    29. <mirrorOf>central</mirrorOf>
    30. </mirror>
    31. <mirror>
    32. <id>nexus-osc-thirdparty</id>
    33. <mirrorOf>thirdparty</mirrorOf>
    34. <name>Nexus osc thirdparty</name>
    35. <url>http://maven.oschina.net/content/repositories/thirdparty/</url>
    36. </mirror>