Maven全配置-基础配置


1.下载:

  官网下载maven  

  开发选择bin版本即可,src为源码

2.配置setting.xml

  需要配置: 镜像 jdk版本 自定义仓库位置

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

<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">  
  <localRepository>D:\java工具\apache-maven-3.8.4\repolocalRepository>  
  <pluginGroups>pluginGroups>  
  <proxies>proxies>  
  <servers>servers>  
  <mirrors> 
    <mirror> 
      <id>nexus-aliyunid>  
      <mirrorOf>*mirrorOf>  
      <name>Nexus aliyunname>  
      <url>http://maven.aliyun.com/nexus/content/groups/publicurl> 
    mirror> 
  mirrors>  
  <profiles> 
    <profile> 
      <id>jdk18id>  
      <activation> 
        <activeByDefault>trueactiveByDefault>  
        <jdk>1.8jdk> 
      activation>  
      <properties> 
        <maven.compiler.source>1.8maven.compiler.source>  
        <maven.compiler.target>1.8maven.compiler.target>  
        <maven.compiler.compilerVersion>1.8maven.compiler.compilerVersion> 
      properties> 
    profile> 
  profiles>  
  <activeProfiles> 
    <activeProfile>jdk18activeProfile> 
  activeProfiles> 
settings>

复制替换即可,我将其内部注释全部去掉(因为看着乱)了

3.配合maven的环境变量

4.cmd测试即可