Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/374.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何解决与maven中央存储库的连接超时?_Java_Maven_Apache Spark - Fatal编程技术网

Java 如何解决与maven中央存储库的连接超时?

Java 如何解决与maven中央存储库的连接超时?,java,maven,apache-spark,Java,Maven,Apache Spark,我的pom.xml(只是一部分)如下所示: <dependency> <groupId>org.apache.spark</groupId> <artifactId>spark-core_2.10</artifactId> <version>2.0.0</version> </dependency

我的pom.xml(只是一部分)如下所示:

            <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_2.10</artifactId>
            <version>2.0.0</version>
        </dependency>

    <dependency>
    <groupId>org.apache.spark</groupId>
    <artifactId>spark-graphx_2.12</artifactId>
    <version>2.4.0</version>
</dependency>

          <dependency>
        <groupId>org.apache.spark</groupId>
        <artifactId>spark-graphx_2.11</artifactId>
        <version>2.0.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.spark</groupId>
        <artifactId>spark-sql_2.11</artifactId>
        <version>2.0.0</version>
    </dependency>
      <dependency>
        <groupId>graphframes</groupId>
        <artifactId>graphframes</artifactId>
        <version>0.6.0-spark2.3-s_2.11</version>
    </dependency>
</dependencies>

<repositories>
    <!-- list of other repositories -->
    <repository>
        <id>SparkPackagesRepo</id>
        <url>http://dl.bintray.com/spark-packages/maven</url>
    </repository>
    <repository>              
          <id>central</id>
          <name>Central</name>
          <url>http://repo1.maven.org/maven2</url>
</repository>
 </repositories>
看起来我无法连接到maven中央存储库,或者连接出现问题。我的错误在哪里

如果注意到连接,请尝试通过端口443连接到repo.maven.apache.org。因此,如果我尝试:
telnet repo.maven.apache.org 443

    Trying 151.101.124.215...
telnet: connect to address 151.101.124.215: Connection timed out
但是 如果我尝试
telnet repo.maven.apache.org 80
命令显示:

Trying 151.101.124.215...
Connected to repo.maven.apache.org.
Escape character is '^]'.
settings.xml如下所示:

<settings>
  <activeProfiles>
    <!--make the profile active all the time -->
    <activeProfile>securecentral</activeProfile>
  </activeProfiles>
  <profiles>
    <profile>
      <id>securecentral</id>
      <!--Override the repository (and pluginRepository) "central" from the
         Maven Super POM -->
      <repositories>
        <repository>
          <id>central</id>
          <url>http://repo1.maven.org/maven2</url>
          <releases>
            <enabled>true</enabled>
          </releases>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://repo1.maven.org/maven2</url>
          <releases>
            <enabled>true</enabled>
          </releases>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
</settings>

安全中心
安全中心
中心的
http://repo1.maven.org/maven2
真的
中心的
http://repo1.maven.org/maven2
真的

错误很可能存在于网络连接中,也可能存在于防火墙中。这不是Maven或编程问题。

也许您可以尝试其他镜像站点

因此,请确定我应该更改什么?取决于您的网络。如果您在公司网络中,请与管理员联系。如果您使用的是私人电脑,请检查互联网连接,检查防火墙并重试。使用此镜像,我得到:Plugin org.apache.maven.plugins:maven resources Plugin:2.6或其一个依赖项无法解析:未能读取org.apache.maven.plugins:maven resources Plugin:jar:2.6:无法传输工件org.apache.maven.plugins:maven resources Plugin:pom:2.6from/to UK():sun.security.validator.ValidatorException:PKIX路径生成失败:sun.security.provider.certpath.SunCertPathBuilderException:找不到请求目标的有效证书路径->[Help 1]您的maven版本是什么?os environment?Maven 3.5 im使用SSH linux服务器。im通过MobaXterm软件连接到此服务器您似乎有代理问题。删除设置后它是否工作。xml?@JFMeier不幸的是否:(@bib,但您不在公司网络中,也不运行防火墙或代理?@bib,当然!正常情况下,我通过MobaXterm连接到远程SSH服务器。在我用来运行实验的prinipal服务器中,我遇到了此错误。但在另一台SSH服务器上,它工作正常。
<settings>
  <activeProfiles>
    <!--make the profile active all the time -->
    <activeProfile>securecentral</activeProfile>
  </activeProfiles>
  <profiles>
    <profile>
      <id>securecentral</id>
      <!--Override the repository (and pluginRepository) "central" from the
         Maven Super POM -->
      <repositories>
        <repository>
          <id>central</id>
          <url>http://repo1.maven.org/maven2</url>
          <releases>
            <enabled>true</enabled>
          </releases>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://repo1.maven.org/maven2</url>
          <releases>
            <enabled>true</enabled>
          </releases>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
</settings>