我下载了一个Scala项目,其中包含了填充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">
<groupId>mapr</groupId>
<artifactId>auctionsapp</artifactId>
<modelVersion>4.0.0</modelVersion>
<name>auctionsapp</name>
<packaging>jar</packaging>
<version>1.0</version>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<encoding>UTF-8</encoding>
<scala.tools.version>2.10</scala.tools.version>
<scala.version>2.10.4</scala.version>
<spark.version>1.5.2</spark.version>
</properties>
<repositories>
<repository>
<id>scala-tools.org</id>
<name>Scala-tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</repository>
<repository>
<id>mapr-releases</id>
<url>http://repository.mapr.com/maven/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_${scala.tools.version}</artifactId>
<version>${spark.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_${scala.tools.version}</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-mllib_${scala.tools.version}</artifactId>
<version>${spark.version}</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.15.2</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
问题在于,当我运行mvn install
时,我得到了:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.992 s
[INFO] Finished at: 2016-11-28T09:43:45+00:00
[INFO] Final Memory: 14M/188M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project auctionsapp: Could not resolve dependencies for project mapr:auctionsapp:jar:1.0: Failed to collect dependencies at org.apache.spark:spark-core_2.10:jar:1.5.2 -> org.apache.hadoop:hadoop-client:jar:2.7.0-mapr-1509 -> org.apache.hadoop:hadoop-common:jar:2.7.0-mapr-1509 -> com.mapr.hadoop:maprfs:jar:5.0.9-mapr: Failed to read artifact descriptor for com.mapr.hadoop:maprfs:jar:5.0.9-mapr: Could not transfer artifact com.mapr:mapr-root:pom:2.0-SNAPSHOT from/to scala-tools.org (http://scala-tools.org/repo-releases): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [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
有什么可能导致这种情况的想法吗?
答案 0 :(得分:0)
无法从/向scala-tools.org(http://scala-tools.org/repo-releases)传输工件com.mapr:mapr-root:pom:2.0-SNAPSHOT: sun.security.validator.ValidatorException:PKIX路径构建失败: sun.security.provider.certpath.SunCertPathBuilderException:无法 找到所请求目标的有效证书路径 - &gt; [帮助1]
SSL证书似乎存在问题。也许这篇文章很有帮助:Problems using Maven and SSL behind proxy