【问题标题】:Having difficulties downloading dependencies下载依赖项有困难
【发布时间】:2015-09-14 01:17:00
【问题描述】:

我无法在 IntelliJ 中下载 junit 和 Selenium 依赖项。 我已经在我的办公室笔记本电脑上安装了 Intellij,要连接到互联网,我们必须通过代理。我已在 IDE 中添加了所有代理详细信息,并且能够连接到 Internet,但是当我尝试下载 junit 和 selenium 依赖项时,我看到以下错误

未找到依赖项 ""junit:junit:4.12"" 检查 Maven 模型的分辨率问题。请帮忙

POM 文件详细信息:-

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>Temp1</groupId>
    <artifactId>Temp1</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.47.1</version>
        </dependency>


        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

【问题讨论】:

    标签: maven selenium


    【解决方案1】:

    您可以使用 Maven (https://maven.apache.org/guides/mini/guide-proxies.html) 配置代理以用于部分或全部 HTTP 请求。你试过吗?

    <settings>
      .
      .
      <proxies>
       <proxy>
          <id>example-proxy</id>
          <active>true</active>
          <protocol>http</protocol>
          <host>proxy.example.com</host>
          <port>8080</port>
          <username>proxyuser</username>
          <password>somepassword</password>
          <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
        </proxy>
      </proxies>
      .
      .
    </settings>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-06-26
      • 2011-05-23
      • 2020-04-30
      • 1970-01-01
      • 1970-01-01
      • 2015-11-05
      • 2011-03-09
      相关资源
      最近更新 更多