The instructions in this article are intended primarily for those UWB CSS students actively engaged in MASS core library development. It is assumed that the developer has basic working knowledge of Java application development and Git usage. In particular, all developers should be able to perform the following operations using Git:
If you are unfamiliar with one or more of these operations, please consult the following resources:
You should have the following installed on your development computer:
Please observe the following guidelines when working with the repository:
There are no formal guidelines as of yet for source code formatting, etc. However, you should follow the following basic guidelines when developing the library:
The core library is structured around Maven. MASS-Java takes advantage of the dependency management and build functionality of Maven; Maven will need to be installed on your computer to build a properly functioning JAR. Maven is a popular tool for managing the development and maintenance lifecycle of Java applications; it is recommended that you visit the Maven home site and become familiar with its’ use. In particular, check out the following topics:
(Even if your IDE provides native support for Maven, it is a good idea to understand how Maven works “behind the scenes”)
Some Java IDEs include Maven (such as NetBeans and IntelliJ IDEA), others may require a plugin. If you decide to use an IDE plugin or native functionality, refer to IDE documentation. For Linux, check to see if there is a installation package available for your distribution. For Windows (and Linux), you may use the ZIP archive available on the Maven home site. If you plan to use Maven from the command line, test your installation using the command “mvn –version”. If the installation is correct, you should see version and environment information returned by Maven.
The project is configured to build when Maven is instructed to execute the “package” build phase. If you are using an IDE plugin or built-in Maven support, refer to IDE instructions for starting the “package” phase. From the command line, “mvn package” executed at the top-level project directory will start the phase. Maven will automatically download any necessary dependencies, compile classes, and create the final JAR artifact. The JAR will be located in the “target” directory; Maven will place the final JAR in this location regardless of the invocation method (IDE, plugin, or command-line).
Invoking Maven will automatically execute unit tests. You may speed up build time (or temporarily work around failing tests) by adding the “-DskipTests” option. For example, to build the library without running unit tests, use the following command: “mvn -DskipTests package”
Version numbers follow a “major.minor.fix-(RELEASE|SNAPSHOT)” scheme. Major numbers are incremented when significant enhancements are made with (typically) API changes. Minor numbers are incremented when enhancements are made requiring few (if any) API changes. Fix numbers are incremented when bug fixes are made and no API changes introduced.
“RELEASE” and “SNAPSHOT” version types have special meaning to Apache Maven. When somebody using the MASS library for an application specifies a “RELEASE” version, that particular artifact is retrieved from a public repository and not refreshed. If a “SNAPSHOT” version is specified, Maven will refresh the local artifact on the user’s workstation (usually) whenever a new application build is triggered.
It is important that the revision scheme is followed, otherwise the wrong version of an artifact may be used in a project.
When updating the version of MASS-Core, you must first determine what the new version will be, including version type. Here are a few examples of proper version numbers:
To change the version of MASS-Core, open a command-prompt in the root
directory of the project. Enter the following command: ‘mvn versions:set
-DnewVersion=
For example, to change the version to “1.3.0-RELEASE”, the command would be as follows: ‘mvn versions:set -DnewVersion=1.3.0-RELEASE’
After Maven updates the project version, it will create a new file with an extension of “.versionsBackup” in the top-level directory. Once you are satisfied that the version number has been updated correctly, remove this file (do not commit this file to the repository).
There are different development activities depending on the nature of the work being performed. In general, there are four different workflows:
The following instructions may refer to the following links:
For all workflows, please note the following:
This workflow is used when major changes are to be made in MASS-Core. Typically a long-running branch will be used for the development activities. #### Workflow Steps 1. Create a new issue or assign an existing issue to yourself 2. Create a branch from “develop” 3. Perform your work on this new branch 4. Merge/delete your branch to “develop” and resolve the issue
Use this workflow when making minor changes in response to an issue in the tracker. #### Workflow Steps 1. Assign the existing issue to yourself 2. Create a branch from “develop” 3. Perform your work on this new branch 4. Merge/delete your branch to “develop” and resolve the issue
Use this workflow when resolving major bugs in a released version of MASS-Core. #### Workflow Steps 1. Create a new issue or assign an existing issue to yourself 2. Create a branch from “master”. Your branch name should be like: ‘tnicely-hotfix-fdiv-error’. 3. Perform your work on this new branch. Your work in this branch should be confined to fixing the problem ONLY. 4. Once work is complete, increment the minor version in the POM (don’t forget to commit!). 5. Merge/delete your branch to “master”, tag this commit with the new version, and resolve the issue. 6. Switch to the “develop” branch and merge your changes FROM “master” TO the “develop” branch.
This workflow is used when it is decided that enhancements to MASS are considered ready to release. #### Workflow Steps 1. Make sure all source code files contain the UW copyright notice, and the year is updated if necessary In the “develop” branch, change the version type from “snapshot” to “release” and update the version number to reflect that nature of the changes since the last release. 2. Commit the updated POM(s). 3. Switch to the “master” branch and merge FROM “develop” TO “master”. 4. Tag this latest commit in the “master” branch with the complete version number. 5. Switch to the “develop” branch and merge your changes from “master” to the “develop” branch. 6. Increment the minor version in “develop” and switch the version type back to “snapshot”.
Make sure to review (or ask for assistance to review) all project documentation to make sure it is still reflects the changes made to the project!