An up-to-date Maven Archetype for Scala with a bunch of out-of-the-box features 🍻
- Scalatest with Scoverage and Surefire report
- OSSRH Maven central repository deployment
- Apache Spark
- Typesasfe config
mvn archetype:generate \
-DarchetypeGroupId=dev.qinx \
-DarchetypeArtifactId=scala-archetype \
-DarchetypeVersion=1.0.0
mvn archetype:generate -B \
-DarchetypeGroupId=dev.qinx \
-DarchetypeArtifactId=scala-archetype \
-DarchetypeVersion=1.0.0 \
-DgroupId=com.company \
-DartifactId=artifact-id \
-Dversion=0.0.1-SNAPSHOT \
-Dpackage=com.company
The following command will run the unit test and generate test report.
mvn scoverage:report
Surefire report will be put into target/surefire-reports
.
Scoverage data and report could be found in:
target/scoverage-data
target/site/scoverage
Project created with this archetype is ready to be deployed to Maven Central Repository. The only things you need to do are:
- prepare your
.m2/settings.xml
<settings> <profiles> <profile> <id>ossrh</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <gpg.executable>gpg</gpg.executable> <gpg.passphrase>the_pass_phrase</gpg.passphrase> </properties> </profile> </profiles> <servers> <server> <id>ossrh</id> <username>your-jira-id</username> <password>your-jira-pwd</password> </server> </servers> </settings>
- prepare your GPG key
gpg --import private.key
Then, use the following command to deploy the artifact:
# SNAPSHOT
mvn deploy -Psnapshot
# RELEASE
mvn deploy -Prelease
Read the OSSRH documentation for more details.