栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

Maven仓库配置环境变量

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Maven仓库配置环境变量

文章目录
    • Maven仓库配置
      • 1.maven下载
      • 2.设置setting.xml 文件
      • 3. 修改jdk版本
      • 4.配置环境变量
      • 5.测试
      • 6.完整的setting.xml文件

Maven仓库配置 1.maven下载

[点击地址]
https://maven.apache.org/download.cgi

2.设置setting.xml 文件

1.解压到自己本地地址磁盘

2.设置setting文件
2.1 修改本地仓库地址,本地仓库用来存放项目jar 包,地址随意。

2.2 修改jar包下载地址,设置成阿里云瞎子啊,大部分情况下,阿里云都可以下载jar包,不过有的公司会有maven私服仓库。


            nexus-aliyun
            central
            Nexus aliyun
            http://maven.aliyun.com/nexus/content/groups/public/
        
        
            central
            Maven Repository Switchboard
            http://repo1.maven.org/maven2/
            central
        
        
            repo2
            central
            Human Readable Name for this Mirror.
            http://repo2.maven.org/maven2/
        
3. 修改jdk版本

看自己使用的是那种版本(注:不修改也可以)获取jdk 方法(唤醒cmd 窗口,已管理员身份运行)。

java -version

4.配置环境变量

按图所示,并保存

JAVA_HOME

编辑Path 路径

%MAVEN_HOME%bin

5.测试

cmd以管理员身份运行

6.完整的setting.xml文件


user.home}/.m2/settings.xml.
 |
 |                 NOTE: This location can be overridden with the CLI option:
 |
 |                 -s /path/to/user/settings.xml
 |
 |  2. Global Level. This settings.xml file provides configuration for all Maven
 |                 users on a machine (assuming they're all using the same Maven
 |                 installation). It's normally provided in
 |                 ${maven.home}/conf/settings.xml.
 |
 |                 NOTE: This location can be overridden with the CLI option:
 |
 |                 -gs /path/to/global/settings.xml
 |
 | The sections in this sample file are intended to give you a running start at
 | getting the most out of your Maven installation. Where appropriate, the default
 | values (values used when the setting is not specified) are provided.
 |
 |-->

  user.home}/.m2/repository
  /path/to/local/repo
  -->
  D:mavenWarehouseMavenRepository
  
  
  
  
    
  
  
  
    
  
  

    
    
  
    
      sundotnexus
      developer
      Dev@sundot
    
    
      sundot-release
      developer
      Dev@sundot
    
    
      sundot-release
      developer
      Dev@sundot
    
    
      sundot-snapshot
      developer
      Dev@sundot
    
  
  
  
    
		
            nexus-aliyun
            central
            Nexus aliyun
            http://maven.aliyun.com/nexus/content/groups/public/
        
        
            central
            Maven Repository Switchboard
            http://repo1.maven.org/maven2/
            central
        
        
            repo2
            central
            Human Readable Name for this Mirror.
            http://repo2.maven.org/maven2/
        
  
	
  

  
    
    tomcatPath}
     |   
     | 
     | ...
     |
     | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
     |       anything, you could just leave off the  inside the activation-property.
     |
    
      env-dev
      
        
          target-env
          dev
        
      
      
        /path/to/tomcat/instance
      
    
    -->
    
        jdk8
        
            true
            1.8
        
        
            1.8
            1.8
            1.8
        
    
     
      nexus
      
         
      
				
        
      
        	
         
    
  
  
       nexus

  

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/880834.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号