How to Create a Scala Artifact with IntelliJ IDEA

SBT and Scala are some of the new technologies being used at Thinkovator so I plan to create a few blog posts to help newbies such as myself when they first are starting to use SBT with Scala.  This article is going to be a walk through of creating an artifact using IntelliJ IDEA to be used by other projects.

Building the artifact to publish

Unfortunately I do not know the command line version of this but would love to learn it so, if someone has any ideas please let me know!

First I will go to the File-> Project Structure ->Artifacts->Add new -> Jar ->  and select From Modules with dependencies

Add artifact

Next select the project you want built for your artifact.  All Modules will pull in all the jars in your project, which may not be exactly what you want or need.  For me I select com.thinkovator.common.authentication to get just that project and it’s dependencies.

Select Module

Then you will want to go to Build -> Build Artifacts and when the window pops open select Build.

Build Artifact

This will create a jar file that we can then used in other projects or we can stash it in a ivy/maven repository to be pulled into the other projects via SBT. To see what that might look like check out my blog on publishing Scala artifacts

Leave a Reply

Your email address will not be published. Required fields are marked *