Managing Dependencies for Spark 2 Projects
With Spark projects, you can add external packages to Spark executors on startup.
To add external dependencies to Spark jobs, specify the libraries you want added by using the appropriate configuration parameters in a spark-defaults.conf file.
For a list of the relevant properties and examples, see Managing Dependencies for Spark 2 Jobs.