maven中的setting.xml配置

<?xml version="1.0" encoding="UTF-8"?>

<settings   xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

    <!--本地仓库。该值表示构建系统本地仓库的路径。其默认值为${user.home}/.m2/repository。  -->
    <localRepository>D:/VIP_SoftWare/maven3.3.9/repository</localRepository>

    <!--Maven是否需要和用户交互以获得输入。如果Maven需要和用户交互以获得输入,则设置成true,反之则应为false。默认为true。 -->
    <interactiveMode>true</interactiveMode>

    <!--Maven是否需要使用plugin-registry.xml文件来管理插件版本。  -->
    <!--如果设置为true,则在{user.home}/.m2下需要有一个plugin-registry.xml来对plugin的版本进行管理  -->
    <!--默认为false。 -->
    <usePluginRegistry>false</usePluginRegistry>

    <!--表示Maven是否需要在离线模式下运行。如果构建系统需要在离线模式下运行,则为true,默认为false。  -->
    <!--当由于网络设置原因或者安全因素,构建服务器不能连接远程仓库的时候,该配置就十分有用。  -->
    <offline>false</offline>
    <mirrors>
    <!--
        <mirror>
            <id>airintelli</id>
            <name>airintelli maven</name>
            <url>http://192.168.1.253:8081/nexus/content/groups/public/</url>
            <mirrorOf>central</mirrorOf>
        </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>repo2</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo2.maven.org/maven2/</url>
        </mirror>
        <mirror>
            <id>net-cn</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://maven.net.cn/content/groups/public/</url>
        </mirror>
        <mirror>
            <id>ui</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://uk.maven.org/maven2/</url>
        </mirror>
        <mirror>
            <id>ibiblio</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
        </mirror>
    </mirrors>
<profiles>
    <profile>
        <id>jdk18</id>
        <activation>
            <activeByDefault>true</activeByDefault>
            <jdk>1.8</jdk>
        </activation>
        <properties>
            <maven.compiler.source>1.8</maven.compiler.source>
            <maven.compiler.target>1.8</maven.compiler.target>
            <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
            <!-- 文件拷贝时的编码 -->
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
            <!-- 编译时的编码 -->
            <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
        </properties>
    </profile>
</profiles>
</settings>

猜你喜欢

转载自blog.csdn.net/weixin_38860565/article/details/81076923