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?
A little late to the party, but I had the same problem with
spark-testing-base
. It stems from the way you modify theartifactName
:which is probably copied from the official SBT docs. Note that the docs have the following hint below the code though:
My solution for
spark-testing-base
is the following:This should make sure to keep the classifier (and whatever additional things might go into the
artifactName
) and solved the problem of JAR files containing documentation instead of class files.