齐柏林飞艇不加载Maven Jar

时间:2020-01-31 05:06:51

标签: maven apache-spark apache-zeppelin

Apache Zeppelin版本0.7.1

%dep
z.reset() // clean up previously added artifact and repository

// add maven repository
z.addRepo("Spark Cassandra Connector 2.0.10").url("https://mvnrepository.com/artifact/com.datastax.spark/spark-cassandra-connector")

// add artifact recursively
// z.load("groupId:artifactId:version")
z.load("com.datastax.spark:spark-cassandra-connector_2.11:2.0.10") 

java.lang.NullPointerException
    at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:352)
    at org.apache.zeppelin.spark.dep.SparkDependencyContext.fetchArtifactWithDep(SparkDependencyContext.java:171)
    at org.apache.zeppelin.spark.dep.SparkDependencyContext.fetch(SparkDependencyContext.java:121)
    at org.apache.zeppelin.spark.DepInterpreter.interpret(DepInterpreter.java:245)
    at org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:95)
    at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:490)
    at org.apache.zeppelin.scheduler.Job.run(Job.java:175)
    at org.apache.zeppelin.scheduler.FIFOScheduler$1.run(FIFOScheduler.java:139)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

以下内容似乎没有帮助:

  1. apache zeppelin additional repository import
  2. https://zeppelin.apache.org/docs/0.7.1/interpreter/spark.html中,给出了将zeppelin.dep.additionalRemoteRepository设置为http://dl.bintray.com/spark-packages/maven的示例,但是此存储库没有我需要的jar版本。
  3. https://zeppelin.apache.org/docs/0.7.1/interpreter/spark.html#3-dynamic-dependency-loading-via-sparkdep-interpreter
  4. Zeppelin dynamic dependency loading fails on os-maven-plugin

现在我要得到

%dep
z.load("com.datastax.spark:spark-cassandra-connector_2.11:2.0.10")

org.sonatype.aether.resolution.DependencyResolutionException: Could not find artifact com.datastax.spark:spark-cassandra-connector_2.11:jar:2.0.10 in central (https://repo1.maven.org/maven2/)

1 个答案:

答案 0 :(得分:3)

我需要将http中的Maven重新定位网址从https更新为zeppelin-env.sh

export ZEPPELIN_INTERPRETER_DEP_MVNREPO="https://repo1.maven.org/maven2/"

我们的构建系统(Jenkins管道)还存在其他特定的非通用更改

如果您可以控制服务器,那么只需下载所需的jar(即"groupArtifactVersion": "com.datastax.spark:spark-cassandra-connector_2.11:2.0.10",),然后从磁盘加载依赖项就容易得多,例如:

%dep
z.load("/opt/zeppelin/spark-cassandra-connector-assembly/spark-cassandra-connector-assembly.jar")