美文网首页
Maven的全局设置-setting.xml

Maven的全局设置-setting.xml

作者: 编程永无止境 | 来源:发表于2019-06-19 22:38 被阅读0次

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

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

    <localRepository>G:/apache-maven-3.6.0/maven_repository</localRepository>

    <pluginGroups>

    </pluginGroups>

    <proxies>

    </proxies>

    <servers>

    <!-- Another sample, using keys to authenticate.
    <server>
      <id>siteServer</id>
      <privateKey>/path/to/private/key</privateKey>
      <passphrase>optional; leave empty if not used.</passphrase>
    </server>
    -->
    

    </servers>

    <mirrors>

    <mirror>
          <id>alimaven</id>
          <name>aliyun maven</name>
          <url>https://maven.aliyun.com/repository/public/</url>
          <mirrorOf>*</mirrorOf>        
    </mirror>
    

    </mirrors>

    <profiles>

      <activation>
        <jdk>1.4</jdk>
      </activation>
    
      <repositories>
        <repository>
          <id>jdk14</id>
          <name>Repository for JDK 1.4 builds</name>
          <url>http://www.myhost.com/maven/jdk14</url>
          <layout>default</layout>
          <snapshotPolicy>always</snapshotPolicy>
        </repository>
      </repositories>
    </profile>
    -->
    
    
    <profile>    
        <id>jdk-1.8</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>    
        </properties>    
    </profile>
    
    <!--
     | Here is another profile, activated by the system property 'target-env' with a value of 'dev',
     | which provides a specific path to the Tomcat instance. To use this, your plugin configuration
     | might hypothetically look like:
     |
     | ...
     | <plugin>
     |   <groupId>org.myco.myplugins</groupId>
     |   <artifactId>myplugin</artifactId>
     |
     |   <configuration>
     |     <tomcatLocation>${tomcatPath}</tomcatLocation>
     |   </configuration>
     | </plugin>
     | ...
     |
     | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
     |       anything, you could just leave off the <value/> inside the activation-property.
     |
    <profile>
      <id>env-dev</id>
    
      <activation>
        <property>
          <name>target-env</name>
          <value>dev</value>
        </property>
      </activation>
    
      <properties>
        <tomcatPath>/path/to/tomcat/instance</tomcatPath>
      </properties>
    </profile>
    -->
    

    </profiles>

    </settings>
    '''

    相关文章

      网友评论

          本文标题:Maven的全局设置-setting.xml

          本文链接:https://www.haomeiwen.com/subject/slolqctx.html