1

As I've downloaded a preview distribution of Apache Spark 2.0, I would like to use it within Intellij within a project of mine.

However, the project is not a standard Maven distribution or similar, but rather purely source code scattered through directories.

My question is, how do I import that source code into Intellij?

yole
  • 92,896
  • 20
  • 260
  • 197
dsafa
  • 783
  • 2
  • 8
  • 29
  • Does the project have any build file? SBT... or anything else? – Ryan Stull Jun 01 '16 at 20:12
  • Just double checked to make sure my memory wasn't faulty. Spark appears to be a maven project, https://github.com/apache/spark/blob/branch-2.0/pom.xml exists and contains the sorts of things I would expect (maven scala plugin configuration, etc) – Angelo Genovese Jun 01 '16 at 20:22

1 Answers1

1

If you want to contribute to Spark, as in modify spark source code, you can import spark as a maven project.

If you want to write code that uses spark, and need it as a dependency, you can either add the dependency in your intellij project by right clicking on the project, selecting module settings, going to libraries, adding a new library using your jar, then going to the modules section and adding that library as a dependency.

Alternatively (and I think preferably) you could publish the jar to your local maven repo using the following command, and then just depend on it normally in a maven project:

mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \
-DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>
Angelo Genovese
  • 3,398
  • 17
  • 23