Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .cursor/rules/ascii-source.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
description: Tracked source and docs must be ASCII only
alwaysApply: true
---

# ASCII source

Every file you **add or edit** must be **ASCII only** (bytes 0x00-0x7F). Scan touched paths before finishing.

Replace:

| Non-ASCII | ASCII |
| ------------------ | ----------- |
| em/en dash, minus | `-` |
| ellipsis | `...` |
| curly quotes | `'` / `"` |
| arrows | `->` / `<-` |
| non-breaking space | space |

Do not introduce Unicode symbols, emoji, or locale punctuation in code, comments, XML, or docs.

WSDL/XSD copied from the licensed toolkit may contain non-ASCII. Do not add more. Prefer ASCII in files you author.
50 changes: 50 additions & 0 deletions .cursor/rules/documentation-standards.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
description: Documentation and build scripts - implementor-first, Maven Central default, no secrets
alwaysApply: true
---

# Documentation and build scripts

Applies when writing or editing **README**, **CONTRIBUTING**, integrator guides, **SECURITY**, release notes, **build.*** / **build.xml** header comments, **settings.xml.example**, **local.properties.example**, and similar tracked material.

## Priority: implementors

- Primary audience: developers **consuming** published Maven artifacts.
- Contributor/maintainer workflow lives in **CONTRIBUTING.md**, **MAINTAINERS.md**, or labelled subsections - not mixed into the integrator main flow.
- Do not duplicate agent workflow in README or CONTRIBUTING (**AGENTS.md** -> `.cursor/rules/`).

## Default narrative: Maven Central

- Write as if **released** coordinates are on Maven Central (no SNAPSHOT, sibling-repo checkout, or `-P...` profiles in the main integrator path).
- Use **version numbers** in integrator docs - not Git branch names.
- SNAPSHOT installs and sibling `mvn install` belong under **Local development** / **Local builds** only.

## Structure

| Where | What |
| ----- | ---- |
| README / integrator docs | Dependency, runtime config, capabilities |
| Local development | Unpublished builds, SNAPSHOT, source-tree prerequisites |
| By OS (when needed) | Separate **Windows**, **macOS**, **Linux** blocks (wrappers, cleanup, path notes) |

## Paths

- **Relative paths only** (e.g. `src/main/resources/`, `pom.xml` beside repo root).
- **Never** hardcode machine paths (`C:\...`, `/Users/...`, `~/`, worktree folders) in tracked docs.
- Override only when strictly required to remove ambiguity - say why.

## Current state only

- No migration, legacy, or branch-history commentary in user-facing docs.
- Describe **what is true now**; omit "removed", "used to", and repo archaeology in integrator material.
- **CHANGELOG** entries: current release capabilities; avoid branch names and migration essays in new notes.

## Secrets - MUST NOT

- **Never** put real or plausible **passwords**, **tokens**, **API keys**, **private keys**, or **keystore passphrases** in tracked files (code, comments, examples, docs).
- Use placeholders or empty values in `.example` files.
- See **SECURITY.md**.

## Override

These rules may be overridden **only when necessary** to clear ambiguity (e.g. maintainer branch mapping in **MAINTAINERS.md** or `.cursor/rules/`, clearly labelled maintainer-only).
45 changes: 45 additions & 0 deletions .cursor/rules/multi-branch-worktrees.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
description: Use git worktree when editing multiple branches of the same repository
alwaysApply: true
---

# Multi-branch work - use git worktree

When a task requires **changes on two or more branches of the same Git repository**, use **`git worktree`** - do **not** hop branches with `git checkout` while carrying uncommitted edits or stashes.

## When this applies

- Same-repo edits across release lines (e.g. `java-8`, `java-11`)
- Applying the same fix to several branches before commit
- Comparing or building two branches side by side

## When checkout is fine

- Single branch for the whole task
- Read-only inspection: `git show <branch>:path`
- Clean working tree and only one target branch

## Workflow

1. **Primary clone** stays on the main working branch; do not stash-and-hop to edit other branches.
2. **Add a worktree per extra branch** (paths are local - never commit them to tracked docs):

```bash
git worktree add ../<repo>-<branch-slug> <branch>
```

3. **Edit and commit in each worktree** independently; verify build/tests per branch.
4. **Remove when done**: `git worktree remove ../<repo>-<branch-slug>` (or `git worktree prune` after manual delete).

## Do not

- `git checkout` other branches with uncommitted changes (Git will block or force stash churn).
- Stash the same files across multiple branch switches - causes merge conflicts on `stash pop`.
- Put worktree directory paths in README, CONTRIBUTING, or other tracked docs (see repo **`worktrees.mdc`** / **`documentation-standards.mdc`**).

## Example (maintainer-local paths only)

```bash
git worktree add <path> java-8
git worktree add <path> java-11
```
38 changes: 38 additions & 0 deletions .cursor/rules/smi-common-utils-project.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# smi-common-utils-java

Maven artifact **`au.gov.nehta:smi-common-utils`** - Java utility classes to assist with CDA library development. **Not** facade clients or HI/MHR services.

## Documentation

Follow **`documentation-standards.mdc`**. Integrator docs use **version numbers** - not Git branch names.

The **first number** of the Maven version is the **Java SE** target.

| Version | Java | Logging |
| ---------- | ---- | ---------------------------------- |
| **8.0.0** | 8 | **SLF4J 1.7.x** (javax-compatible) |
| **11.0.0** | 11 | **SLF4J 2.0.18** |

**Git branch mapping (maintainers only - never in integrator docs):**

| Version | Official Git branch |
| ---------- | ------------------- |
| **8.0.0** | `java-8` |
| **11.0.0** | `java-11` |

## This 11.0.0 line

**`11.0.0-SNAPSHOT`**: Java **11**, SLF4J **2.0.18**. No JAX-WS dependencies.

## Build

- JDK **11+**, from repo root: `mvn -B "-Dgpg.skip=true" clean verify` (quote `-D` on PowerShell).
- Default Surefire: all tests.
- **`-Pcoverage`**: JaCoCo report.

## Doc split

- **`documentation-standards.mdc`**: implementor-first, Maven Central default, local/OS sections, relative paths, no secrets
- **`README.md`**: integrators (Maven Central default)
- **`CONTRIBUTING.md`**: build from source, local SNAPSHOT
- **`MAINTAINERS.md`**: POM internals
37 changes: 37 additions & 0 deletions .cursor/rules/worktrees.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
description: Worktree paths are local only - versions belong in integrator docs
alwaysApply: true
---

# Worktrees (local convenience only)

**`git worktree`** lets a maintainer check out multiple branches of the **same repository** at once. Worktree **directory paths are machine-specific** and must **not** appear in tracked documentation.

## What tracked docs describe

Follow **`documentation-standards.mdc`** (implementor-first, Maven Central default).

| Doc | Audience | Use |
| --- | --------- | --- |
| **README**, integrator guides | Implementors | **Maven version** (`11.0.0`), Central coordinates, JAR contents |
| **CONTRIBUTING** | Contributors | Build from source, **Local builds**, OS-specific steps |
| **MAINTAINERS**, **`.cursor/rules/`** | Maintainers | POM internals; **branch mapping** only when labelled maintainer-only |

Integrator docs: **version numbers**, not Git branch names. Local/SNAPSHOT flows: **CONTRIBUTING** only.

## Do not put in tracked docs

- Hardcoded worktree or machine paths (`wt/`, `C:\...`, `/Users/...`, `~/`, `this worktree`, `primary clone`)
- References to **`wt/README.md`** or other local-only layout files
- "Open folder X to switch branches" - IDE/local workflow, not repo documentation

## Allowed (maintainer-only, when labelled)

- **Git branch mapping** table (version -> branch) in **MAINTAINERS.md** or agent rules
- Generic worktree example only: `git worktree add <path> <branch>` (placeholder **`<path>`**, never a committed example)
- Optional **untracked** local notes outside the repo

## When editing docs

1. Identify the **Maven version / release line** the text applies to, not the worktree folder Cursor has open.
2. Remove or rewrite any committed worktree path tables or branch names in integrator-facing files.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

on:
push:
branches: [ java-11 ]
pull_request:
branches: [ java-11 ]

permissions:
contents: read

jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "11"
cache: maven
- name: Maven verify
run: mvn -B "-Dgpg.skip=true" clean verify
13 changes: 13 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Cursor agents

Rules: `.cursor/rules/*.mdc`. Do not duplicate in README or CONTRIBUTING.

| Concern | Rule |
|---------|------|
| ASCII only in authored files | `ascii-source.mdc` |
| Documentation and build scripts (implementor-first, Central, local, OS, paths, no secrets) | `documentation-standards.mdc` |
| smi-common-utils scope, build, version lines | `smi-common-utils-project.mdc` |
| Worktrees local only; versions in integrator docs | `worktrees.mdc` |
| Multi-branch edits in one repo - use worktree, not checkout/stash | `multi-branch-worktrees.mdc` |

Contributors (humans): README, CONTRIBUTING, MAINTAINERS, SECURITY, CHANGELOG.
40 changes: 29 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
# Change Log/Revision History
# Changelog

= 1.2.1 =
=========
- Converted to Maven to allow deployment to Maven repo
## 11.0.0

No record of previous releases available.
- Java 11 release line (`maven.compiler.release=11`)
- Jakarta XML Bind API 4.0.5
- SLF4J 2.0.18
- Java 11 idioms: NIO.2 UTF-8 file I/O, `List.of`, `Objects.equals`, `DateTimeFormatter`, `ConcurrentHashMap`, try-with-resources, `Class<?>`

## 8.0.0

- Version line aligned to Java 8 (`maven.compiler.release=8`)
- Distribution migrated to Sonatype Central Portal (`central-publishing-maven-plugin`)
- Updated `slf4j` to 1.7.36 (last 1.7.x on Maven Central)
- Plugin versions updated: compiler 3.15.0, surefire 3.5.5, javadoc 3.12.0, source 3.4.0, gpg 3.2.8
- GPG signing skipped by default; enabled via `-Prelease`

## 1.2.1

- Converted to Maven
- Replaced external dependencies with Maven ones

## 1.2.0

- Added support for JVM 1.7_21+

## 1.0

= 1.2.0 =
=========
17 Feb 2010

= 1.0 =
=======
- Initial release

## Copyright

Copyright 2009 NEHTA. Copyright 2021-2026 ADHA. Apache License 2.0 - see **LICENSE.txt**.
46 changes: 46 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributing

## Prerequisites

- JDK 11
- Maven 3.6+

## Local builds

```
# Windows
mvn -B "-Dgpg.skip=true" clean verify

# macOS / Linux
mvn -B -Dgpg.skip=true clean verify
```

## Local SNAPSHOT install

To install to your local Maven repository without signing:

```
mvn -B "-Dgpg.skip=true" clean install
```

## Running tests

Tests run automatically during `verify`. To skip:

```
mvn -B "-Dgpg.skip=true" -DskipTests clean package
```

## Code style

- Java 11 source and target (`maven.compiler.release=11`)
- All source files must be ASCII only
- SLF4J 2.0.18 API

## Pull requests

Target the `java-11` branch. Ensure `mvn verify` passes before opening a PR.

## Copyright

Copyright 2009 NEHTA. Copyright 2021-2026 ADHA. Apache License 2.0 - see **LICENSE.txt**.
34 changes: 34 additions & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Maintainers

## Artifact

`au.gov.nehta:smi-common-utils` - published to Maven Central via Sonatype Central Portal.

## Version lines

| Version | Java | Branch |
| ---------- | ------------ | --------- |
| **8.0.0** | 8 / javax | `java-8` |
| **11.0.0** | 11 / Jakarta | `java-11` |

## Key dependency

| Property | Value |
| --------------- | -------- |
| `slf4j.version` | `2.0.18` |

To update: change `slf4j.version` in `pom.xml` properties, run `mvn verify`.

## Release process

1. Ensure `java-11` branch is green.
2. `mvn -B release:prepare release:perform -Prelease` (GPG key required).
3. Sonatype Central Portal auto-publishes after closing.

## Publishing credentials

`settings.xml` with `<server id="central">` - see `settings.xml.example`.

## Copyright

Copyright 2009 NEHTA. Copyright 2021-2026 ADHA. Apache License 2.0 - see **LICENSE.txt**.
Loading