我有一个使用spark graphX模块的Spark代码。我需要在graphX中进行更改并强制我的项目使用graphX的这个修改版本。为了做到这一点,我首先从spark源代码中取出了graphx模块并独立编译。然后我在我的应用程序pom.xml文件中指定依赖项,该文件的范围是“system”。有我的应用程序pom。
<?xml version="1.0" encoding="UTF-8"?>
http://maven.apache.org/maven-v4_0_0.xsd">
edu.asu.gears.examples.spark
PageRank
jar
"PageRank"
1.0
4.0.0
<java.version>1.8.0</java.version>
<scala.version>2.11.8</scala.version>
<scala.binary.version>2.11</scala.binary.version>
<scala.tools.version>2.11</scala.tools.version>
<spark.version>2.3.2</spark.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<blaze.version>1.0</blaze.version>
<blaze.base>/home/user/sbiookag/blaze-master</blaze.base>
<pluginRepository>
<id>scala-tools.org</id>
<name>Scala-tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</pluginRepository>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-graphx_${scala.binary.version}</artifactId>
<version>${spark.version}</version>
<scope>system</scope>
<systemPath>${blaze.base}/examples/pageRank/APPs/GraphXFPGAApp/graphx/target/spark-graphx_2.11-3.0.0-SNAPSHOT.jar</systemPath>
</dependency>
<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.binary.version}</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-mllib_${scala.binary.version}</artifactId>
<version>${spark.version}</version>
</dependency>
<!--
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>blaze_${scala.binary.version}</artifactId>
<version>1.0.1</version>
</dependency>
-->
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
当我编译我的代码时,它仍然下载graphx依赖项,似乎它在运行时也使用原始的jar文件。我真的不知道如何解决这个问题。
park-mllib包含依赖spark-graphx。您应该在pom.xml中将其排除:
org.apache.spark
spark-mllib_${scala.binary.version}
${spark.version}
<exclusion>
<groupId>org.apache.spark</groupId>
<artifactId>spark-graphx_${scala.binary.version}</artifactId>
</exclusion>
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。