I followed this guide to release a Scala / SBT JAR file in Maven.
I ran the sbt publishSigned and sbt sonatypeRelease for the spark-fast-tests 0.11.0 release and the JAR file was correctly built. See here. These commands come from the sbt-sonatype plugin.
For some reason, when I did the 0.12.0 release, the Maven JAR file only includes HTML files and images. For example, the downloaded JAR file contains this file com/github/mrpowers/spark/fast/tests/DatasetComparer.html, but doesn't include DatasetComparer.class.
The target/scala-2.11/spark-fast-tests_2.11-2.3.0_0.12.0.jar file also only includes the HTML files (either sbt publishSigned or sbt sonatypeRelease must have generated this JAR file).
When I run sbt package, the JAR file that's generated includes the Scala classes like com/github/mrpowers/spark/fast/tests/DatasetComparer.class, as expected.
spark-fast-tests is an open source project and here is the build.sbt file.
How can I include my project classes in the JAR file that's uploaded to Maven? Any tips / tricks on how to debug this better?
Analysing spark-fast-tests
build.sbtI would make the following recommendations:Add
sbt-releasetoplugins.sbtto enable release process customisation:Create
version.sbtat project root and moveversionsetting out ofbuild.sbt:Create
sonatype.sbtat project root and move the following settings out ofbuild.sbt:Add the following release settings to
build.sbt:Release to Maven Central with
sbt releaseFor a working example have a look at build configuration of
sbt-sonatypeitself.