2016-04-21 79 views

回答

2

你可以从S3下载罐子,并把它放在本地FS。它可以%DEP内部完成解释是这样的:

%dep 
import com.amazonaws.services.s3.AmazonS3Client 
import java.io.File 
import java.nio.file.{Files, StandardCopyOption} 

val dest = "/tmp/dependency.jar" 
val s3 = new AmazonS3Client() 
val stream = s3.getObject("buckename", "path.jar").getObjectContent 

Files.copy(stream, new File(dest).toPath, StandardCopyOption.REPLACE_EXISTING) 

z.load(dest) 

注:必须生成脂肪的罐子,即包括默认情况下不提供的所有定制的依赖(例如,当你在你的项目中多个模块)。在maven中,它可以使用maven-shade-plugin实现:

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-shade-plugin</artifactId> 
    <version>2.4.2</version> 
    <executions> 
     <execution> 
      <phase>package</phase> 
      <goals> 
       <goal>shade</goal> 
      </goals> 
      <configuration> 
       <artifactSet> 
        <includes> 
         <include>com.yourcompany:*</include> 
        </includes> 
       </artifactSet> 
      </configuration> 
     </execution> 
    </executions> 
</plugin> 
+0

非常感谢!有没有办法可以回答这个问题?谢谢! http://stackoverflow.com/questions/37251236/apache-zeppelin-running-code-automatically-on-startup – shakedzy

+0

我不认为这会工作了。 “不推荐使用DepInterpreter(%dep),而是通过GUI解释器菜单来加载依赖关系。” – Jeremy

+0

我按照说明将jar上传到本地文件系统,然后进入解释器菜单并使用相同路径添加依赖关系。“/tmp/dependency.jar” – Jeremy

相关问题