在maven文件夹下的setting.xml文件夹下查找标签,将下列代码添加进去

    1. <mirror>
    2. <!--This sends everything else to /public -->
    3. <id>aliyun maven</id>
    4. <mirrorOf>central</mirrorOf>
    5. <name>aliyun maven</name>
    6. <url>http://maven.aliyun.com/nexus/content/groups/public</url>
    7. </mirror>

    并且在标签下添加如下代码控制maven对应的jdk版本,代码如下:

    1. <profile>
    2. <id>jdk-1.7</id>
    3. <activation>
    4. <activeByDefault>true</activeByDefault>
    5. <jdk>1.7</jdk>
    6. </activation>
    7. <properties>
    8. <maven.compiler.source>1.7</maven.compiler.source>
    9. <maven.compiler.target>1.7</maven.compiler.target>
    10. <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
    11. </properties>
    12. </profile>