Appendix A. Deployment Prerequisites

Table of Contents

A.1. How profile-based distribution management has been designed
A.2. Prerequisites for Deploying Corporate Artifacts (from the umbrella project)
A.3. Prequisites for Deploying Sister Project Artifacts

Abstract

This appendix describes prerequisites for deploying artifacts from both this, the corporate "umbrella" project, and also from other sister projects. It is only applicable if you have been given admin permissions to release code for the Star Objects project.

A.1. How profile-based distribution management has been designed

The corporate POM defines two <profile>s that allow deployments to be rehearsed by deploying locally, and then when ready deployed remotely. These contain <distributionManagement> tags activated by a property key. This allows us to rehearse a deployment (by deploying locally) of the corporate artifacts before actually doing the deployment proper (deploying remotely).

To deploy locally, we add:

-D dist=local

And to deploy remotely, we instead add:

-D dist=remote

All code artifacts, for all sister projects, are deployed to the repositories represented by the starobjects-snapshot or starobjects-release server definitions. However, each sister project has its own site.

Every POM defining artifacts being site-deployed must specify (or inherit) a number of properties. For example, starobjects' own settings are:

<properties>
    ...
  <distMgmtArtifactId>starobjects</distMgmtArtifactId>
  <distMgmtArtifactName>Star Objects</distMgmtArtifactName>
  <distMgmtArtifactSfDir>s/st/starobjects</distMgmtArtifactSfDir>
</properties>

Similarly, Tested Objects has:

<properties>
    ...
  <distMgmtArtifactId>testedobjects</distMgmtArtifactId>
  <distMgmtArtifactName>Tested Objects</distMgmtArtifactName>
  <distMgmtArtifactSfDir>t/te/testedobjects</distMgmtArtifactSfDir>
</properties>

Other sister projects similarly need to setup these properties.

These properties are then used in <distributionManagement>. For a local deploy, we use the following profile:

<profile>
  <id>dist-local</id>
  <!-- USE -D dist=local TO SELECT -->
  <activation>
    <property>
      <name>dist</name>
      <value>local</value>
    </property>
  </activation>
  <distributionManagement>
    <snapshotRepository>
      <id>starobjects-snapshot</id>
      <name>Star Objects Local Snapshot Repository</name>
      <url>file:///tmp/m2-repo/snapshot</url>
      <uniqueVersion>false</uniqueVersion>
    </snapshotRepository>
    <repository>
      <id>starobjects-release</id>
      <name>Star Objects Local Release Repository</name>
      <url>file:///tmp/m2-repo/release</url>
    </repository>
    <site>
      <id>${distMgmtArtifactId}-site</id>
      <name>${distMgmtArtifactName} Site</name>
      <url>file:///tmp/m2-sites/${distMgmtArtifactId}</url>
    </site>
  </distributionManagement>
</profile>

Any deployment using this profile will put into /tmp.

Remote deployments on the other hand SFTP/SCP files up to sourceforge:

<profile>
  <id>dist-remote</id>
  <!-- USE -D dist=remote TO SELECT -->
  <activation>
    <property>
      <name>dist</name>
      <value>remote</value>
    </property>
  </activation>
  <distributionManagement>
    <snapshotRepository>
      <id>starobjects-snapshot</id>
      <name>Star Objects Snapshot Repository</name>
      <url>
        sftp://web.sourceforge.net/home/groups/s/st/starobjects/htdocs/m2-repo/snapshot
      </url>
      <uniqueVersion>false</uniqueVersion>
    </snapshotRepository>
    <repository>
      <id>snapshot-release</id>
      <name>Star Objects Release Repository</name>
      <url>
        sftp://web.sourceforge.net/home/groups/s/st/starobjects/htdocs/m2-repo/release
      </url>
    </repository>
    <site>
      <id>${distMgmtArtifactId}-site</id>
      <name>${distMgmtArtifactName} Site</name>
      <url>scp://shell.sourceforge.net/home/groups/${distMgmtArtifactSfDir}/htdocs/m2-site</url>
    </site>
  </distributionManagement>
</profile>

For a local deployment to work the directories under /tmp should be exist:

  • /tmp/m2-repo/snapshot and /tmp/m2-repo/release for the repositories

  • /tmp/m2-sites for the various sites.

For a remote deployment to work requires an entry in the settings.xml for the named server id. The umbrella project and all sister projects share the same server Ids for deploying code releases (as per Chapter 10, Deploying a Code Release) but every umbrella project will define its own server for deploying its site. In effect this means that the settings.xml will contain:

  • starobjects-snapshot

    for both the umbrella project and all sister projects' deployments of code snapshots

  • starobjects-release

    for both the umbrella project and all sister projects' deployments of code releases

  • starobjects-site

    for the umbrella project's site

  • xxxobjects-site

    for each sister project xxxobject's site

This is spelt out below