<?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>D:/m2/repository</localRepository> <pluginGroups> <pluginGroup>org.mortbay.jetty</pluginGroup> </pluginGroups> <proxies> </proxies> <servers> <server> <id>nexus-releases</id> <username>ali</username> <password>123456</password> </server> </servers> <mirrors> </mirrors> <profiles> <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> <profile> <id>downloadSources</id> <properties> <downloadSources>true</downloadSources> <downloadJavadocs>true</downloadJavadocs> </properties> </profile> <profile> <id>aliyun</id> <repositories> <repository> <id>aliyun</id> <url>https://maven.aliyun.com/repository/public</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </repository> </repositories> </profile> <profile> <id>nexus-releases</id> <repositories> <repository> <id>nexus-releases</id> <url>http://10.3.87.5:8082/repository/maven-public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </repository> </repositories> </profile> </profiles> <activeProfiles> <activeProfile>aliyun</activeProfile> <activeProfile>nexus-releases</activeProfile> </activeProfiles> </settings>
注意:這裡面設定了maven.compiler.source,當環境中有jdk1.8以下版本時用maven打包時會報jdk低版本的提示,需要統一打包時jdk的版本,因此需要在此指定