Skip to content

An up-to-date Maven Archetype for Scala with a bunch of out-of-the-box features 🍻

License

Notifications You must be signed in to change notification settings

qxzzxq/scala-archetype

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scala-archetype

build Maven Central

An up-to-date Maven Archetype for Scala with a bunch of out-of-the-box features 🍻

Features

Usage

Interactive mode:

mvn archetype:generate \
  -DarchetypeGroupId=dev.qinx \
  -DarchetypeArtifactId=scala-archetype \
  -DarchetypeVersion=1.0.0

Batch mode

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

Run test and generate report

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

Deploy to Maven Central Repository

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.