解决公司用内网IDEA无法下载Maven相关的jar

解决公司用内网IDEA无法下载Maven相关的jar

之前下载maven相关的jar只要是配置好了,下载都没有问题,公司现在是用内网的,但是没想到跟公司内网有关系,折腾好久才弄好,随便记录下吧,也可以帮助更多的人。

1.配置好相关Maven
选择File——》Settings…——》 Build, Execution, Deployment——》Maven
在这里插入图片描述

2.配置Http *****
File ——》 Settings ——》Appearance & Behavior-》Http Proxy
在这里插入图片描述

3.修改settings.xml文件 *****
我的是放在D盘 ——》D:\Develop\maven\apache-maven-3.3.9\conf目录下面
在这里插入图片描述
在这里插入图片描述
配置到这里就可以去更新Maven相关ja包,下载完就可以跑项目,耐心找Bug吧。。。

下面完整的settings.xml文件

<?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:/maven_repository</localRepository>

  <pluginGroups>
  
  </pluginGroups>

 
  <proxies>
    <!-- 设置代理   -->
    <proxy>
      <id>optional</id>	
      <active>true</active>
      <protocol>http</protocol>
      <username></username>
      <password></password>
      <host>10.244.xxx.xxx</host>
      <port>8081</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts> 
    </proxy> 
  </proxies>

  <mirrors>
        <mirror>
            <id>alimaven</id>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
		
		 <mirror>
			<id>nexus-aliyun</id>
			<mirrorOf>central</mirrorOf>
			<name>Nexus aliyun</name>
			<url>https://maven.aliyun.com/nexus/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>jboss-public-repository-group</id>
            <mirrorOf>central</mirrorOf>
            <name>JBoss Public Repository Group</name>
            <url>http://repository.jboss.org/nexus/content/groups/public</url>
        </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>OSChina</id>
            <name>OSChina Central</name>
            <url>http://maven.oschina.net/content/groups/public/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
        <mirror>
            <id>nexus-osc-thirdparty</id>
            <mirrorOf>thirdparty</mirrorOf>
            <name>Nexus osc thirdparty</name>
            <url>http://maven.oschina.net/content/repositories/thirdparty/</url>
        </mirror>
    </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>nexus</id>
    <!--Enable snapshots for the built in central repo to direct -->
    <!--all requests to nexus via the mirror -->
    <repositories>
      <repository>
        <id>smartit-snapshot</id>
        <url>http://192.168.0.250:8080/nexus/content/repositories/smartit-snapshot/</url>
        <releases>
          <enabled>false</enabled>
        </releases>
        <snapshots>
          <enabled>true</enabled>
        </snapshots>
      </repository>
      <repository>
        <id>nexus-aliyun</id>
        <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
        <releases>
          <enabled>true</enabled>
        </releases>
        <snapshots>
          <enabled>false</enabled>
        </snapshots>
      </repository>
    </repositories>
    
    <pluginRepositories>
      <pluginRepository>
        <id>nexus-aliyun</id>
        <url>http://nexus-aliyun</url>
        <releases><enabled>true</enabled></releases>
        <snapshots><enabled>true</enabled></snapshots>
      </pluginRepository>
    </pluginRepositories>
  </profile>
  </profiles>
  
  <activeProfiles>
    <activeProfile>nexus</activeProfile>
  </activeProfiles>


</settings>

  • 0
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值