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:ApacheSpark在尝试;mvn包“;_Java_Maven_Apache Spark - Fatal编程技术网

Java Maven:ApacheSpark在尝试;mvn包“;

Java Maven:ApacheSpark在尝试;mvn包“;,java,maven,apache-spark,Java,Maven,Apache Spark,我已经在本地安装了spark 1.3.1,方法是下载zip并将其解压缩到我的主存储库中,这样我就可以在home/my user name/spark-1.3.1中找到它。 下一件事是我想使用Java,为了让它工作,我通过以下命令安装了maven: $ sudo apt-get install maven 然后,我用以下命令检查了版本: mvn -version 这给了我这个: Maven home: /usr/share/maven Java version: 1.7.0_80, vendo

我已经在本地安装了spark 1.3.1,方法是下载zip并将其解压缩到我的主存储库中,这样我就可以在home/my user name/spark-1.3.1中找到它。
下一件事是我想使用Java,为了让它工作,我通过以下命令安装了maven:

$ sudo apt-get install maven
然后,我用以下命令检查了版本:

mvn -version
这给了我这个:

Maven home: /usr/share/maven
Java version: 1.7.0_80, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.16.0-38-generic", arch: "amd64", family: "unix"
接下来,我想从当前的托存文档中使用Maven创建一个java项目/:

mvn archetype:generate -DgroupId=projet -DartifactId=Indexing -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
这意味着我的pom.xml文件位于存储库文档/projet/index中/ 以下是我在pom.xml中得到的信息:

<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>mif37.projet</groupId>
  <artifactId>Indexing</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>IndexingMapReduce</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>
但最后我得到的是:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9:18.021s
[INFO] Finished at: Sun May 31 20:49:52 CEST 2015
[INFO] Final Memory: 12M/137M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Indexing: Could not resolve dependencies for project projet:Indexing:jar:1.0-SNAPSHOT: Could not transfer artifact org.apache.spark:spark-core_2.10:jar:1.3.1 from/to central (http://repo.maven.apache.org/maven2): GET request of: org/apache/spark/spark-core_2.10/1.3.1/spark-core_2.10-1.3.1.jar from central failed: Connection reset -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
任何人都可以指出我做错了什么??
谢谢。

您的pom.xml和过程很好。存在防火墙/连接问题-如所述:

.spark:spark-core_2.10:jar:1.3.1 from/to central (http://repo.maven.apache.org/maven2): GET request of: org/apache/spark/spark-core_2.10/1.3.1/spark-core_2.10-1.3.1.jar from central failed: Connection reset -> [Help 1]
[ERROR] 

您可以在一个“开放”的环境中重复您的步骤,例如在家里而不是在工作中进行验证。

这里很好。您是否可以运行
mvn package-X
以启用完整的调试日志记录和错误更新?您是否在代理之后?mvn不尊重系统范围的代理设置,您必须将它们添加到~/.m2/settings.xml中
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9:18.021s
[INFO] Finished at: Sun May 31 20:49:52 CEST 2015
[INFO] Final Memory: 12M/137M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Indexing: Could not resolve dependencies for project projet:Indexing:jar:1.0-SNAPSHOT: Could not transfer artifact org.apache.spark:spark-core_2.10:jar:1.3.1 from/to central (http://repo.maven.apache.org/maven2): GET request of: org/apache/spark/spark-core_2.10/1.3.1/spark-core_2.10-1.3.1.jar from central failed: Connection reset -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
.spark:spark-core_2.10:jar:1.3.1 from/to central (http://repo.maven.apache.org/maven2): GET request of: org/apache/spark/spark-core_2.10/1.3.1/spark-core_2.10-1.3.1.jar from central failed: Connection reset -> [Help 1]
[ERROR]