Deploy Scala application via SBT

I used IntelliJ to create a Scala project and generate a JAR file for deployment. 

Firstly, create a Scala project.


Specify the external libraries required in the build.sbt file.



Create and save the scala application in the folder ./src/main/scala 



Import the external libraries from build.sbt. Right-click on the build.sbt file, select 'Repair IDE on File,' and click 'Rescan Project Indexes'.


The external libraries will be automatically imported based on the specifications in the build.sbt file



Define the Artifacts within the Project Structure menu




Build project

                            
                            

Build Artifacts




I utilized spark-submit to execute the Scala application using the JAR file

spark-submit --name "scala_shuup_txn_json_upsert" \

--master spark://192.168.1.34:7077 \
--total-executor-cores 2 \
--driver-memory 2g \
--executor-memory 4g \
--packages org.apache.spark:spark-sql-kafka-0-10_2.12:3.0.1 \
--class mac_spark_shuup_txn_json_upsert ./jar/scala-shuup-txn-json-upsert.jar