Skip to content

JPL-IMCE/imce.sbt.plugin

Repository files navigation

JPL's IMCE SBT Plugin for Java, Scala, AspectJ projects

This sbt plugin aggregates a few community plugins used across several projects in JPL's Integrated Model-Centric Engineering initiative and in OMG's Tool Infrastructure Working Group.

There is an inherent tradeoff between maintaining slight variations of similar build configurations across multiple projects (i.e. no common sbt plugin) and defining a common sbt plugin reused across multiple projects to simplify their build configurations.

Conceptually, the scope and purpose of this sbt plugin is very similar to the elegant nice-sbt-settings. Practically, nice-sbt-settings is indeed nicer.

Build Status Download

Usage

sbt configuration

in project/plugins.sbt, add:

resolvers += Resolver.bintrayRepo("jpl-imce", "gov.nasa.jpl.imce")

addSbtPlugin("gov.nasa.jpl.imce.sbt", "imce.sbt.plugin", "<version>")

Two-stage publication to Bintray

Bintray package version upload (aka sbt publish or sbt publishSigned)

  1. in build.sbt, add:
  • configuration for publishing to bintray:
// publish SBT and non-SBT artifacts as Maven artifacts (i.e. with *.pom)
publishMavenStyle := true

// publish to bintray.com via: `sbt publish`
publishTo := Some(
  "JPL-IMCE" at
    s"https://api.bintray.com/content/jpl-imce/gov.nasa.jpl.imce/imce.sbt.plugin/${version.value}")

This requires specifying the Bintray credentials:

credentials += Credentials("Bintray API Realm", "api.bintray.com", "<user>", "<bintray API key>")
  • configuration for resolving from bintray:
resolvers += Resolver.bintrayRepo("jpl-imce", "gov.nasa.jpl.imce")

For resolving unpublished artifacts, resolution requires credentials:

credentials += Credentials("Bintray", "dl.bintray.com", "<user>", "<bintray API key")
  1. Phase 1: Upload to bintray

In Bintray, when a user uploads artifact files to a package version, the uploaded artifacts are available (i.e. resolvable in Maven/SBT terminology) only for that authenticated user.

  • Note: this will upload the sbt artifact files to bintray.
sbt publish

or:

sbt publishSigned
  1. Phase 2: Discard or Publish the uploaded artifact files for a package version

In Bintray, the uploaded artifact files for a project version can be:

  • discarded => delete the uploaded artifact files: nobody can resolve them.
  • published => make the uploaded artifact files publicly available: everyone can resolve them.

Note that bintray keeps unpublished uploaded artifact files for a short period (it seems to be ~ 6 days), after which they are discarded.

During this period, unpublished artifact files for a package version can be tested (only with properly authenticated access).

  • Via the JFrog CLI:

    • Install the JFrog CLI

    • publish: jfrog bt vp <subject>/<organization>/<package>/<version>

    • disacard: jfrog bt vd <subject>/<organization>/<package>/<version>

  • Via the bintray.com web UI:

    • Go to: https://bintray.com/<subject>/<organization>/<package>/<version>

    • There are separate buttons for publishing & discarding.

User configuration

  • Edit ~/.gnupg/gpg.conf:
use-agent
no-tty
  • Edit ~/.gitconfig to add:
[commit]
	gpgsign = true

or:

git config --global commit.gpgsign true

Additional Information

Useful links