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>