Project Structure

NGSS defines conventions for project directory and file structure, depending on the type of service. For most projects, Maven is the preferred build tool, and most of the supplementary build and deployment tools rely on Maven.

When creating a new project, initial files and directories can be generated using the official Mobile Service Archetype.

For existing projects, some NGSS-standard files can be configured to download automatically (updating to latest version of each file) or manually fetched from the CKM Deployment Templates repository. These templates are processed with the NGSS Filegen Maven Plugin, replacing placeholders with project-specific values during the build if it is automatic, or as a result of manually running a Filegen Maven plugin goal.

Java-based Services

Here is an example layout for a Maven multi-module project.

📁 my-service
  📁 docs
  📁 kubernetes (1)
  📁 my-service
    📁 src
      📁 main
        📁 java
        📁 resources
      📁 test
    📄 metadata.yaml (2)
  📁 my-service-client
  📁 scripts (3)
  📁 templates (4)
  📄 .java-version
  📄 .kubernetes-hash.sha256 (5)
  📄 CHANGELOG.md
  📄 jenkins.yaml (6)
  📄 Jenkinsfile (7)
  📄 lombok.config
  📄 pom.xml
  📄 README.md
  📄 skaffold.yaml (8)
1 Kubernetes configs implemented as a collection of Kustomize overlays for Kubernetes deployments. See Kustomize/Kubernetes for more info. The skaffold.yaml file references these overlays within profile configurations defined for different uses and/or environments.
2 NGSS-standard project metadata file, containing info about environment and Vault variables, JIRA project ID, etc.
3 Supplemental scripts for Skaffold and Kustomize automation (not usually run manually).
4 Templates and related configs for certain project files - usually just for updating the project’s vv.yaml.
5 File that contains the hash value of the kubernetes directory, used as an input for the scripts/localize.sh script for checking whether any files have changed since the last build. If there are changes, the kustomize localize command is run for each Kustomize overlay.
6 The NGSS Jenkins Shared Library config file, used for defining the build and deployment actions for the project.
7 The Jenkins build script executed in each environment to build the application, push the Docker image to the respective Docker Trusted Registry (DTR), and publish to the Nexus Maven repository, as well as other optional tasks.
8 The skaffold.yaml configuration file used by Skaffold to build the service container image, deploy the service to Kubernetes clusters, and other supporting actions like running tests and verification tasks.