From a27f39dad66d5aa886fe3537a6bf2f1f492114d8 Mon Sep 17 00:00:00 2001 From: Jerry Combs Date: Wed, 11 Nov 2026 09:29:58 -0600 Subject: [PATCH] Maven Central: com.pointbluetech coordinates, flattened pom, publish-central MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - groupId com.pointblue.dirxml -> com.pointbluetech.dirxml (the verified Central namespace), for dirxml-dev and the simulator it depends on. Java packages unchanged. Launchers, require-engine.sh and doctor look for the simulator under the new path; doctor reads a simulator jar's version under either groupId. bin/install-deps installs the pinned 1.8.0 there. - flatten-maven-plugin: the installed/published pom has no profiles, so no engine jar and no systemPath. - url, organization, developers, scm; a `central` profile (sources, javadoc, gpg, bundle built but not uploaded). - bin/publish-central: builds the bundle, refuses it if any file names something on the publish blocklist (outside every repo), uploads that same bundle to the Central Portal (token from the Keychain). - bin/install-deps: groupId from the pinning pom; skips versions on Central. - install.md: dirxml-dev before console-auth (which builds on it); §2.0.1. - A client name in ApplicationType's javadoc and designer-new-project.md, found by the blocklist check, is replaced. Full mvn install passes; doctor OK. A scratch 0.70.0 bundle: signed, pom names only postgresql, jldap, trace-core (and junit, test). Co-Authored-By: Claude Opus 5.5 --- .gitignore | 1 + CHANGELOG.md | 28 +++++ bin/idm | 6 +- bin/idm.cmd | 6 +- bin/install-deps | 45 ++++--- bin/publish-central | 105 ++++++++++++++++ bin/require-engine.sh | 8 +- docs/agent-assisted-setup.md | 6 +- docs/designer-new-project.md | 2 +- docs/install.md | 38 ++++-- docs/spikes/README.md | 2 +- pom.xml | 117 +++++++++++++++++- .../java/com/pointblue/dirxml/dev/Doctor.java | 21 ++-- .../dirxml/dev/source/ApplicationType.java | 2 +- .../com/pointblue/dirxml/dev/DoctorTest.java | 30 ++++- .../dirxml/dev/SyntheticDriverSet.java | 2 +- 16 files changed, 361 insertions(+), 58 deletions(-) create mode 100755 bin/publish-central diff --git a/.gitignore b/.gitignore index 63943d25..b4051dc7 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,4 @@ mcp/**/node_modules/ *.tfstate *.tfstate.* .terraform.lock.hcl +.flattened-pom.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index f133264a..845423d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,34 @@ and this project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html) ## [Unreleased] +### Changed + +- **Maven coordinates move to `com.pointbluetech` for Maven Central:** DirXMLDev is + `com.pointbluetech.dirxml:dirxml-dev`, and it depends on `com.pointbluetech.dirxml:dirxml-simulator`. + Java packages do not change. `bin/idm`, `bin/idm.cmd`, `require-engine.sh` and `doctor` look for the + simulator under `~/.m2/repository/com/pointbluetech/dirxml/`. **After updating, run `bin/install-deps`**: + it installs the pinned simulator (1.8.0) under the new groupId. `doctor` reads a simulator jar's version + under either groupId. +- The installed (and published) pom is flattened: it names no engine jar and no `systemPath`, only + JLDAP, PostgreSQL and the trace parser. +- `bin/install-deps` takes each library's groupId from the pom that pins it, and skips a version that is + on Maven Central (Maven fetches it). +- `docs/install.md` §2.0: `dirxml-dev` comes before `console-auth`, which builds on it; §2.0.1 is + Maven Central. + +### Added + +- **`bin/publish-central`:** publishes a release of a Point Blue library to Maven Central. It builds the + checkout's `central` profile (sources, javadoc, signatures), refuses the bundle when any file in it + names something on the publish blocklist (kept outside every repository), and uploads that same + bundle. The token comes from the Keychain and the signing key from gpg-agent. A `central` profile in + this pom. + +### Fixed + +- A client name in a source comment and in `docs/designer-new-project.md` (an example driver's name) + is gone. + ## [0.69.0] - 2026-11-11 ### Added diff --git a/bin/idm b/bin/idm index 285a7385..a9b3d53c 100755 --- a/bin/idm +++ b/bin/idm @@ -10,7 +10,7 @@ set -e HERE="$(cd "$(dirname "$0")/.." && pwd)" SIM_VER="${IDM_SIM_VERSION:-1.8.0}" -SIM_JAR="$HOME/.m2/repository/com/pointblue/dirxml/dirxml-simulator/$SIM_VER/dirxml-simulator-$SIM_VER.jar" +SIM_JAR="$HOME/.m2/repository/com/pointbluetech/dirxml/dirxml-simulator/$SIM_VER/dirxml-simulator-$SIM_VER.jar" # the PostgreSQL JDBC driver for the event store (the version the pom names; `mvn package` fetches it) PG_VER=$(sed -n 's#.*\([^<]*\).*#\1#p' "$HERE/pom.xml" | head -1) PG_JAR="$HOME/.m2/repository/org/postgresql/postgresql/$PG_VER/postgresql-$PG_VER.jar" @@ -97,7 +97,7 @@ doctor_shell() { fi sim_ok=0 - sim_detail="Install the DirXML Simulator and run 'mvn install' in that repo so $SIM_JAR exists (version $SIM_VER, the pin in pom.xml). See docs/install.md section 2." + sim_detail="Run bin/install-deps (or 'mvn install' in the DirXMLSimulator repo at that version) so $SIM_JAR exists (version $SIM_VER, the pin in pom.xml). See docs/install.md section 2." if [ -f "$SIM_JAR" ]; then sim_ok=1 sim_detail="dirxml-simulator $SIM_VER is on disk; the Java doctor reads its version once target/classes is built." @@ -177,7 +177,7 @@ if [ -z "$JH" ]; then fi if [ ! -f "$SIM_JAR" ] && [ "$CMD" != "doctor" ]; then - echo "ERROR: simulator jar $SIM_VER not installed; run 'mvn install' in the DirXMLSimulator repo" >&2 + echo "ERROR: simulator jar $SIM_VER not installed; run bin/install-deps" >&2 exit 1 fi diff --git a/bin/idm.cmd b/bin/idm.cmd index fe99d0c2..01ef6922 100644 --- a/bin/idm.cmd +++ b/bin/idm.cmd @@ -30,19 +30,19 @@ if not "%JV:~0,3%"=="21." ( ) set "SIM_VER=%IDM_SIM_VERSION%" if "%SIM_VER%"=="" set "SIM_VER=1.8.0" -set "SIM_JAR=%USERPROFILE%\.m2\repository\com\pointblue\dirxml\dirxml-simulator\%SIM_VER%\dirxml-simulator-%SIM_VER%.jar" +set "SIM_JAR=%USERPROFILE%\.m2\repository\com\pointbluetech\dirxml\dirxml-simulator\%SIM_VER%\dirxml-simulator-%SIM_VER%.jar" if not exist "%SIM_JAR%" ( if /I "%CMD%"=="doctor" ( if not exist "%HERE%\target\classes\com\pointblue\dirxml\dev\Cli.class" ( echo DirXML Dev — doctor echo simulator: FAIL %SIM_VER% missing - echo Run "mvn install" in the DirXMLSimulator repo so %SIM_JAR% exists. See docs/install.md section 2. + echo Run bin/install-deps from Git Bash, or "mvn install" in the DirXMLSimulator repo, so %SIM_JAR% exists. See docs/install.md section 2. echo cli: FAIL Java doctor did not start echo DOCTOR: PROBLEMS FOUND exit /b 1 ) ) else ( - echo ERROR: simulator jar %SIM_VER% not installed; run "mvn install" in the DirXMLSimulator repo 1>&2 + echo ERROR: simulator jar %SIM_VER% not installed; run bin/install-deps from Git Bash, or "mvn install" in the DirXMLSimulator repo 1>&2 exit /b 1 ) ) diff --git a/bin/install-deps b/bin/install-deps index 7e952c4f..637b2103 100755 --- a/bin/install-deps +++ b/bin/install-deps @@ -1,8 +1,9 @@ #!/usr/bin/env bash # Installs the Point Blue libraries that DirXMLDev and DirXMLDevWeb build against, at the -# versions a pom pins, from their GitHub releases into the local Maven repository. None of -# them is on Maven Central, so without this each one has to be built from a checkout of the -# right tag, in the right order (DirXMLDev docs/install.md §2.0). +# versions a pom pins, from their GitHub releases into the local Maven repository. A version +# that is on Maven Central is skipped: Maven fetches it by itself. Older versions are only on +# GitHub releases; without this each one has to be built from a checkout of the right tag, in +# the right order (DirXMLDev docs/install.md §2.0). # # bin/install-deps # what this checkout's pom pins # bin/install-deps --pom path/pom.xml # what another pom pins @@ -15,8 +16,10 @@ # dirxml-dev dirxmldev.version PointBlueTechnology/DirXMLDev # console-auth console.version PointBlueTechnology/directory-console # -# A version already in the local repository is left alone, so a jar you built yourself from -# a checkout wins; --force replaces it with the release jar. The NetIQ/OpenText engine jars +# The groupId is the one the pom names for that library (com.pointbluetech.* from the Maven +# Central releases, com.pointblue.* before). A version already in the local repository is +# left alone, so a jar you built yourself from a checkout wins; --force replaces it with the +# release jar. The NetIQ/OpenText engine jars # are proprietary and are never downloaded: copy them into lib/ yourself (DirXMLDev docs/install.md). # Needs curl and mvn. M2_REPO installs into another local repository than ~/.m2/repository. # The same script is in DirXMLDev and DirXMLDevWeb (bin/install-deps); keep the two identical. @@ -45,19 +48,27 @@ done REPO=${M2_REPO:-$HOME/.m2/repository} ALL="trace-core simulator console-auth dirxml-dev" -# name -> "property groupId artifactId owner/repo" +# name -> "property artifactId owner/repo" spec() { case "$1" in - trace-core) echo "tracecore.version com.pointbluetech dirxml-trace-core PointBlueTechnology/DirXMLTraceViewer" ;; - simulator) echo "simulator.version com.pointblue.dirxml dirxml-simulator PointBlueTechnology/DirXMLSimulator" ;; - console-auth) echo "console.version com.pointblue.console console-auth PointBlueTechnology/directory-console" ;; - dirxml-dev) echo "dirxmldev.version com.pointblue.dirxml dirxml-dev PointBlueTechnology/DirXMLDev" ;; + trace-core) echo "tracecore.version dirxml-trace-core PointBlueTechnology/DirXMLTraceViewer" ;; + simulator) echo "simulator.version dirxml-simulator PointBlueTechnology/DirXMLSimulator" ;; + console-auth) echo "console.version console-auth PointBlueTechnology/directory-console" ;; + dirxml-dev) echo "dirxmldev.version dirxml-dev PointBlueTechnology/DirXMLDev" ;; *) return 1 ;; esac } pinned() { sed -n "s#.*<$1>\([^<]*\).*#\1#p" "$POM" | head -1; } +# The groupId the pom gives a dependency on that artifactId: the last before it. +group_of() { + awk -v a="$1" ' + // { g = $0; sub(/.*[[:space:]]*/, "", g); sub(/[[:space:]]*<\/groupId>.*/, "", g) } + // { x = $0; sub(/.*[[:space:]]*/, "", x); sub(/[[:space:]]*<\/artifactId>.*/, "", x) + if (x == a && g != "") { print g; exit } }' "$POM" +} + # The pom installed with each jar. The jars' own poms name parents and system-scoped engine # jars a consumer does not have, so a flat one is written instead. Only trace-core needs a # dependency carried along (JLDAP, on Maven Central); the projects that use the others @@ -87,22 +98,28 @@ echo "pins from $POM" status=0 for n in $NAMES; do set -- $(spec "$n") - prop=$1 group=$2 artifact=$3 gh=$4 + prop=$1 artifact=$2 gh=$3 v=$(pinned "$prop") - if [ -z "$v" ]; then - if [ "$explicit" = 1 ]; then echo " $n: the pom does not pin it (no <$prop>)" >&2; status=1; fi + group=$(group_of "$artifact") + if [ -z "$v" ] || [ -z "$group" ]; then + if [ "$explicit" = 1 ]; then echo " $n: the pom does not pin it (no <$prop>, or no dependency on $artifact)" >&2; status=1; fi continue fi jar="$REPO/$(echo "$group" | tr . /)/$artifact/$v/$artifact-$v.jar" have=0; [ -f "$jar" ] && have=1 if [ "$LIST" = 1 ]; then - if [ "$have" = 1 ]; then echo " $n $v installed"; else echo " $n $v missing"; fi + if [ "$have" = 1 ]; then echo " $n $v installed ($group)"; else echo " $n $v missing ($group)"; fi continue fi if [ "$have" = 1 ] && [ "$FORCE" = 0 ]; then echo " $n $v already installed (--force replaces it with the release jar)" continue fi + central="https://repo1.maven.org/maven2/$(echo "$group" | tr . /)/$artifact/$v/$artifact-$v.pom" + if [ "$FORCE" = 0 ] && curl -fsI -o /dev/null "$central" 2>/dev/null; then + echo " $n $v on Maven Central ($group): Maven fetches it, nothing to install" + continue + fi url="https://github.com/$gh/releases/download/v$v/$artifact-$v.jar" if [ "$DRY" = 1 ]; then echo " $n $v would install from $url"; continue; fi echo " $n $v from $url" diff --git a/bin/publish-central b/bin/publish-central new file mode 100755 index 00000000..4bbf0d83 --- /dev/null +++ b/bin/publish-central @@ -0,0 +1,105 @@ +#!/usr/bin/env bash +# Publishes a Point Blue library to Maven Central from a release checkout: builds the signed bundle +# with the checkout's `central` profile, refuses it if any file in it names something on the +# publish blocklist, and uploads that same bundle to the Central Portal. +# +# bin/publish-central ~/IdeaProjects/DirXMLSimulator +# bin/publish-central --module trace-core ~/IdeaProjects/DirXMLTraceViewer +# bin/publish-central --check-only ~/IdeaProjects/DirXMLDev # build and check, no upload +# +# Central never deletes a release, so the check comes first and nothing is uploaded without it. +# blocklist PUBLISH_BLOCKLIST, default ~/.config/pointblue/publish-blocklist: one name per line +# (client names, their domains), matched case-insensitively as whole words in every file +# of the bundle, class files and the jars inside it included ("acme" does not match +# "acmetric"). A line "substring:acme" matches anywhere, "AcmeDriver" too. Kept outside +# every repository: the list itself must never be published. Missing or empty: refused. +# token the Central Portal user token, from the macOS Keychain: service maven-central, +# account = the token's user name, password = the token's password. +# signing gpg's default key, or PUBLISH_GPG_KEY; the passphrase is gpg-agent's (pinentry). +# +# The checkout must be clean and at the annotated tag v of its pom's release version. +# --hold uploads for review: publish it at https://central.sonatype.com/publishing/deployments. +set -euo pipefail + +usage() { sed -n '2,21p' "$0" | sed 's/^# \{0,1\}//'; } + +MODULE="" +CHECK_ONLY=0 +HOLD=0 +while [ $# -gt 0 ]; do + case "$1" in + --module) [ $# -ge 2 ] || { echo "publish-central: --module needs a name" >&2; exit 2; }; MODULE=$2; shift 2 ;; + --check-only) CHECK_ONLY=1; shift ;; + --hold) HOLD=1; shift ;; + -h|--help) usage; exit 0 ;; + -*) echo "publish-central: unknown option $1 (see --help)" >&2; exit 2 ;; + *) break ;; + esac +done +[ $# -eq 1 ] || { usage >&2; exit 2; } +DIR=$(cd "$1" && pwd) +die() { echo "publish-central: $*" >&2; exit 1; } + +BLOCKLIST=${PUBLISH_BLOCKLIST:-$HOME/.config/pointblue/publish-blocklist} +[ -s "$BLOCKLIST" ] || die "no blocklist at $BLOCKLIST (one name per line). Nothing is published without it." +TMP=$(mktemp -d) +trap 'rm -rf "$TMP"' EXIT +WORDS="$TMP/words" SUBS="$TMP/substrings" +grep -v '^[[:space:]]*\(#\|$\)' "$BLOCKLIST" | sed 's/[[:space:]]*$//' > "$TMP/all" || true +[ -s "$TMP/all" ] || die "the blocklist at $BLOCKLIST has no names in it" +grep -v '^substring:' "$TMP/all" > "$WORDS" || true +sed -n 's/^substring://p' "$TMP/all" > "$SUBS" + +# The release: a clean checkout at the tag of a non-SNAPSHOT version. +cd "$DIR" +[ -z "$(git status --porcelain)" ] || die "$DIR has uncommitted changes" +POM=pom.xml +[ -n "$MODULE" ] && POM="$MODULE/pom.xml" +VERSION=$(mvn -B -q -f "$POM" help:evaluate -Dexpression=project.version -DforceStdout 2>/dev/null) +case "$VERSION" in ''|*-SNAPSHOT) die "the version is '$VERSION': release versions only" ;; esac +TAG=$(git describe --exact-match --tags HEAD 2>/dev/null || true) +[ "$TAG" = "v$VERSION" ] || die "HEAD is not at tag v$VERSION (it is at '${TAG:-no tag}')" + +# Build and sign the bundle. The profile stops short of uploading (skipUpload). +ARGS=(-B -Pcentral deploy) +[ -n "$MODULE" ] && ARGS+=(-pl "$MODULE") +[ -n "${PUBLISH_GPG_KEY:-}" ] && ARGS+=("-Dgpg.keyname=$PUBLISH_GPG_KEY") +echo "building the bundle for $(basename "$DIR") ${MODULE:+$MODULE }$VERSION" +mvn -q "${ARGS[@]}" +BUNDLE="$DIR/${MODULE:+$MODULE/}target/central-publishing/central-bundle.zip" +[ -f "$BUNDLE" ] || die "no bundle at $BUNDLE (does the pom have the central profile?)" + +# Check every file in the bundle, and every file inside each jar in it. +mkdir -p "$TMP/b" +unzip -q "$BUNDLE" -d "$TMP/b" +find "$TMP/b" -name '*.jar' | while read -r j; do mkdir -p "$j.x" && unzip -q "$j" -d "$j.x"; done +[ -n "$(find "$TMP/b" -name '*.asc' | head -1)" ] || die "the bundle has no signatures (.asc)" +HITS=$( { [ -s "$WORDS" ] && grep -rilawF -f "$WORDS" "$TMP/b"; [ -s "$SUBS" ] && grep -rilaF -f "$SUBS" "$TMP/b"; } | sort -u || true) +if [ -n "$HITS" ]; then + echo "publish-central: REFUSED: these files name something on the blocklist:" >&2 + echo "$HITS" | sed "s#^$TMP/b/# #" >&2 + exit 1 +fi +echo "checked: $(find "$TMP/b" -type f | wc -l | tr -d ' ') files, none names anything on the blocklist" +[ "$CHECK_ONLY" = 1 ] && { echo "--check-only: not uploaded ($BUNDLE)"; exit 0; } + +# Upload that same bundle. +ACCT=$(security find-generic-password -s maven-central 2>/dev/null | sed -n 's/.*"acct"="\(.*\)"/\1/p') +[ -n "$ACCT" ] || die "no maven-central item in the Keychain (security add-generic-password -s maven-central -a -w)" +AUTH=$(printf '%s:%s' "$ACCT" "$(security find-generic-password -s maven-central -a "$ACCT" -w)" | base64) +TYPE=AUTOMATIC; [ "$HOLD" = 1 ] && TYPE=USER_MANAGED +NAME="$(basename "$DIR")${MODULE:+-$MODULE}-$VERSION" +ID=$(curl -fsS -X POST -H "Authorization: Bearer $AUTH" -F "bundle=@$BUNDLE" \ + "https://central.sonatype.com/api/v1/publisher/upload?publishingType=$TYPE&name=$NAME") +echo "uploaded $NAME: deployment $ID" +while :; do + sleep 10 + STATUS=$(curl -fsS -X POST -H "Authorization: Bearer $AUTH" "https://central.sonatype.com/api/v1/publisher/status?id=$ID") + STATE=$(printf '%s' "$STATUS" | sed -n 's/.*"deploymentState" *: *"\([A-Z_]*\)".*/\1/p') + case "$STATE" in + PENDING|VALIDATING|PUBLISHING) printf ' %s\n' "$STATE" ;; + VALIDATED) echo "validated, held for review: publish it at https://central.sonatype.com/publishing/deployments"; exit 0 ;; + PUBLISHED) echo "published. Search shows it within the hour; resolving works within minutes."; exit 0 ;; + *) echo "publish-central: deployment $ID is $STATE" >&2; printf '%s\n' "$STATUS" >&2; exit 1 ;; + esac +done diff --git a/bin/require-engine.sh b/bin/require-engine.sh index b0ca0e8d..b640f480 100755 --- a/bin/require-engine.sh +++ b/bin/require-engine.sh @@ -13,7 +13,7 @@ if [ "${1:-}" = "--inform" ]; then fi HERE=$(cd "$(dirname "$0")/.." && pwd) SIM_VER="${IDM_SIM_VERSION:-1.8.0}" -SIM_JAR="${HOME}/.m2/repository/com/pointblue/dirxml/dirxml-simulator/${SIM_VER}/dirxml-simulator-${SIM_VER}.jar" +SIM_JAR="${HOME}/.m2/repository/com/pointbluetech/dirxml/dirxml-simulator/${SIM_VER}/dirxml-simulator-${SIM_VER}.jar" missing="" links="" @@ -78,9 +78,9 @@ Setup (docs/install.md, section 2): or a Designer install. Do not commit them. Do not use: ln -s /path/to/DirXMLSimulator/lib lib Do not symlink the individual jars into lib/. Neither passes requireFilesExist. - 2. Build the simulator and install it into the local Maven repository: - cd /path/to/DirXMLSimulator && mvn install - Expected artifact: com.pointblue.dirxml:dirxml-simulator:${SIM_VER} + 2. Install the simulator into the local Maven repository: bin/install-deps + (or build it: cd /path/to/DirXMLSimulator && git checkout v${SIM_VER} && mvn install) + Expected artifact: com.pointbluetech.dirxml:dirxml-simulator:${SIM_VER} (IDM_SIM_VERSION overrides that pin only when you mean to select another build). 3. Re-run: mvn -B test Without the jars, doctor and the write-gate tests still run: diff --git a/docs/agent-assisted-setup.md b/docs/agent-assisted-setup.md index cc413ec1..d8649792 100644 --- a/docs/agent-assisted-setup.md +++ b/docs/agent-assisted-setup.md @@ -247,7 +247,7 @@ Clone https://github.com/PointBlueTechnology/DirXMLSimulator into ~/IdeaProjects/DirXMLSimulator (or another directory I name). Copy the ten jars into that repo's lib/. With JAVA_HOME pointed at JDK 21, run mvn install. That must produce -~/.m2/repository/com/pointblue/dirxml/dirxml-simulator/1.8.0/dirxml-simulator-1.8.0.jar +~/.m2/repository/com/pointbluetech/dirxml/dirxml-simulator/1.8.0/dirxml-simulator-1.8.0.jar (on Windows, under %USERPROFILE%\.m2). DirXMLDev pins 1.8.0. A release zip of the simulator is not a substitute. Set IDM_SIM_VERSION only if I asked. @@ -401,7 +401,7 @@ when that Java is 21, /usr/lib/jvm/*21*, and java on PATH when that java is 21. On Windows, bin\idm.cmd uses only IDM_JAVA_HOME or JAVA_HOME. Simulator: this repo pins dirxml-simulator 1.8.0. doctor looks for -~/.m2/repository/com/pointblue/dirxml/dirxml-simulator/1.8.0/dirxml-simulator-1.8.0.jar +~/.m2/repository/com/pointbluetech/dirxml/dirxml-simulator/1.8.0/dirxml-simulator-1.8.0.jar (bin\idm.cmd uses %USERPROFILE%\.m2\...). Produce it with mvn install in the DirXMLSimulator repo, run with JDK 21, or with bin/install-deps simulator in DirXMLDev, which installs the release jar. If mvn install succeeded and doctor @@ -497,7 +497,7 @@ show me DOCTOR: OK, or the next failure that is not a symlink. |---|---|---|---|---| | **macOS** | `/usr/libexec/java_home -v 21` finds it; Homebrew or a Temurin JDK installs it (the agent asks first). Run Maven with the same `JAVA_HOME` | `bin/idm` | The Keychain. An item added with `security` is read without a prompt; one made in Keychain Access asks once (choose Always Allow). A missing item's error names the command to run | `chmod 600` both properties files; the tool warns once per run when either is readable by others | | **Linux** | `IDM_JAVA_HOME`, else a `JAVA_HOME` that is 21, else `/usr/lib/jvm/*21*`, else `java` on `PATH` when it is 21. The distro's OpenJDK 21 (`openjdk-21-jdk` on Debian and Ubuntu, `java-21-openjdk-devel` on Fedora and RHEL) and Maven 3.9 or newer are enough | `bin/idm` | `passwordCommand=` or `passwordEnv=` | `chmod 600` as on macOS; `XDS.jar` must keep its capitals on a case-sensitive filesystem | -| **Windows** | `IDM_JAVA_HOME` or `JAVA_HOME` only; no search. The simulator jar is under `%USERPROFILE%\.m2\repository\com\pointblue\dirxml\dirxml-simulator\1.8.0\` | `bin\idm.cmd`; Git Bash or WSL can run `bin/idm`, which has the fuller search and reads `$HOME/.m2` — use one home directory for Maven and the launcher | `passwordCommand=` or `passwordEnv=`; there is no Keychain | The mode-600 warning is a POSIX check; keep the two properties files out of git and out of shared folders | +| **Windows** | `IDM_JAVA_HOME` or `JAVA_HOME` only; no search. The simulator jar is under `%USERPROFILE%\.m2\repository\com\pointbluetech\dirxml\dirxml-simulator\1.8.0\` | `bin\idm.cmd`; Git Bash or WSL can run `bin/idm`, which has the fuller search and reads `$HOME/.m2` — use one home directory for Maven and the launcher | `passwordCommand=` or `passwordEnv=`; there is no Keychain | The mode-600 warning is a POSIX check; keep the two properties files out of git and out of shared folders | A fresh Designer project from a vault, without Designer connecting, is a later task: [howto-fresh-designer-project.md](howto-fresh-designer-project.md). diff --git a/docs/designer-new-project.md b/docs/designer-new-project.md index 694242f1..e9ad33ca 100644 --- a/docs/designer-new-project.md +++ b/docs/designer-new-project.md @@ -679,7 +679,7 @@ bin/idm export-project tree/ --new byte-identical `_license.xml`, `_readme.txt`, `_.properties` and `_contents.xml` files. Only the minted ids differ. 7. **SCIM drivers keep `GenericApp`.** Designer's driver definitions map `SCIM-Driver` to a - `SCIM` application type, but `test11pf`'s `MITLL-Druva` — a `SCIM-Driver` — has a + `SCIM` application type, but `test11pf`'s Druva driver — a `SCIM-Driver` — has a `GenericApp` application, so `SCIM-Driver` is deliberately absent from the driver-type table and a SCIM shim class returns `GenericApp`. 8. **The driver set carries only what the tree records** (deviation for §4 of the N3 brief). diff --git a/docs/install.md b/docs/install.md index 2051e729..d60f8439 100644 --- a/docs/install.md +++ b/docs/install.md @@ -41,15 +41,16 @@ Roles and resources are in scope as AppConfig objects (`role.*`, `resource.*`, ` ### 2.0 Which repositories, in which order DirXMLDev is one of five repositories that build against each other. Each `pom.xml` pins the -versions of the others it uses. None of them is on Maven Central, so Maven finds them only once -they are in your local repository (`~/.m2`). +versions of the others it uses. The libraries are moving to Maven Central under the groupId +`com.pointbluetech` (§2.0.1). A pinned version that is there, Maven fetches by itself; one that +is not, Maven finds only once it is in your local repository (`~/.m2`). | Order | Repository | Gives | Pinned by | |---|---|---|---| | 1 | [DirXMLTraceViewer](https://github.com/PointBlueTechnology/DirXMLTraceViewer) | `dirxml-trace-core`, the trace parser | DirXMLDev and DirXMLDevWeb: `tracecore.version` | | 2 | [DirXMLSimulator](https://github.com/PointBlueTechnology/DirXMLSimulator) | `dirxml-simulator`; building it needs the engine jars in its `lib/` | DirXMLDev and DirXMLDevWeb: `simulator.version` | -| 3 | [directory-console](https://github.com/PointBlueTechnology/directory-console) | `console-auth` (sign-in and TLS trust for the web) | DirXMLDevWeb: `console.version` | -| 4 | DirXMLDev (this repository) | `dirxml-dev` | DirXMLDevWeb: `dirxmldev.version` | +| 3 | DirXMLDev (this repository) | `dirxml-dev` | DirXMLDevWeb and directory-console: `dirxmldev.version` | +| 4 | [directory-console](https://github.com/PointBlueTechnology/directory-console) | `console-auth` (sign-in and TLS trust for the web; it builds on `dirxml-dev`) | DirXMLDevWeb: `console.version` | | 5 | [DirXMLDevWeb](https://github.com/PointBlueTechnology/DirXMLDevWeb) | the web workbench | nothing | Build only the repositories you are changing. `bin/install-deps` installs the others from their @@ -73,6 +74,22 @@ The engine jars are never downloaded: they are proprietary, and §2.1 says where The simulator's release jar replaces building the simulator, but `validate`'s compile check, `simulate` and the package checksums still need the engine jars in DirXMLDev's `lib/` (§2.2). +#### 2.0.1 Maven Central + +The Point Blue libraries are published to Maven Central under `com.pointbluetech`: +`com.pointbluetech:dirxml-trace-core`, `com.pointbluetech.dirxml:dirxml-simulator`, +`com.pointbluetech.dirxml:dirxml-dev` and `com.pointbluetech.console:console-auth`. The first +version of each on Central is the first released after the move; earlier versions stay on GitHub +releases only, under the old groupIds (`com.pointblue.*`), and `install-deps` installs them under +whichever groupId the pinning pom names. No engine jar is ever published: the poms on Central are +flattened and name only open-source dependencies. + +Maintainers publish a release with `bin/publish-central ` (`--module trace-core` for the +trace viewer). It builds the repository's `central` profile (sources, javadoc, gpg signatures), +refuses the bundle when any file in it names something on the publish blocklist (client names, kept +outside every repository), and uploads that same bundle. Central never deletes a release; the +script's header says where the token, the key and the blocklist come from. + ### 2.1 The simulator and the engine jars ```bash @@ -95,13 +112,12 @@ cd ~/IdeaProjects/DirXMLSimulator && JAVA_HOME=$(/usr/libexec/java_home -v 21) m Not changing the simulator? Skip that build: `bin/install-deps` in DirXMLDev (§2.2) installs its release jar at the pinned version. The clone is still a handy place to keep the engine jars. -Resolving that installed `dirxml-simulator` may print that its POM is invalid: -`systemPath` is still the literal `${project.basedir}/lib/...`, which fails -Maven's absolute-path rule. That text is in the simulator artifact under -`~/.m2`, written when the simulator was installed. It is not this repository's -POM, and copying jars into DirXMLDev's `lib/` does not rewrite it. System-scoped -dependencies are not transitive; this project declares the same jars itself. -The message can appear whenever the engine profile resolves the simulator. +A simulator built from source before 1.9.0 installs a pom that still names its +engine jars with the literal `${project.basedir}/lib/...` `systemPath`, and +resolving it may print that the POM is invalid. Harmless: system-scoped +dependencies are not transitive, and this project declares the same jars itself. +From 1.9.0 the installed pom is flattened and names no engine jar; `install-deps` +installs a flat pom for any version. ### 2.2 DirXMLDev diff --git a/docs/spikes/README.md b/docs/spikes/README.md index 2f3f85ae..5602691c 100644 --- a/docs/spikes/README.md +++ b/docs/spikes/README.md @@ -23,7 +23,7 @@ touches a real object in any vault. ```bash export JAVA_HOME=…/zulu-21 mvn -q compile -java -cp "target/classes:$(ls lib/*.jar | tr '\n' ':')$HOME/.m2/repository/com/pointblue/dirxml/dirxml-simulator/1.5.0/dirxml-simulator-1.5.0.jar" \ +java -cp "target/classes:$(ls lib/*.jar | tr '\n' ':')$HOME/.m2/repository/com/pointbluetech/dirxml/dirxml-simulator/1.5.0/dirxml-simulator-1.5.0.jar" \ -Dspike.url=ldaps://HOST:636 -Dspike.bindDn='cn=admin,ou=sa,o=system' -Dspike.password=… \ -Dspike.driverSetDn='cn=driverset1,o=system' \ com.pointblue.dirxml.dev.spike.LdapWriteSpike diff --git a/pom.xml b/pom.xml index a3b94696..1c18b16e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.pointblue.dirxml + com.pointbluetech.dirxml dirxml-dev 0.69.0 jar @@ -13,6 +13,12 @@ Agent-driven IDM (DirXML) development: a typed model of a driver set, IDM-as-code on disk, validation, and vault deploy/operate with safeguards — built on the DirXML Policy Simulator as its test engine. + https://github.com/PointBlueTechnology/DirXMLDev + + + Point Blue Technology + https://www.pointbluetech.com + @@ -22,6 +28,20 @@ + + + Point Blue Technology + Point Blue Technology + https://www.pointbluetech.com + + + + + https://github.com/PointBlueTechnology/DirXMLDev + scm:git:https://github.com/PointBlueTechnology/DirXMLDev.git + scm:git:git@github.com:PointBlueTechnology/DirXMLDev.git + + 21 UTF-8 @@ -34,7 +54,8 @@ ${project.basedir}/lib 42.7.7 + On Maven Central from 1.12.0; earlier versions come from a DirXMLTraceViewer release + (bin/install-deps, docs/install.md). --> 1.10.0 @@ -132,7 +153,7 @@ true - DirXMLDev needs the proprietary NetIQ/OpenText jars as regular files in a real lib/ directory, and dirxml-simulator ${simulator.version} installed by 'mvn install' in the DirXMLSimulator repo. They are not committed and not on Maven Central. A directory symlink of lib/, or a symlink of a jar, is not enough: requireFilesExist reports that path as missing. Copy the jars; an engine from 4.10.2 on ships xp.jar as xp-1.0.0.jar — copy it as xp.jar. `mvn test` is the full suite and stops here when they are absent or linked. Doctor and the write gate still run without them: mvn -B -Pidm.portable test. See docs/install.md section 2 and bin/require-engine.sh. + DirXMLDev needs the proprietary NetIQ/OpenText jars as regular files in a real lib/ directory, and dirxml-simulator ${simulator.version} in ~/.m2 (bin/install-deps installs it). The engine jars are not committed and not on Maven Central. A directory symlink of lib/, or a symlink of a jar, is not enough: requireFilesExist reports that path as missing. Copy the jars; an engine from 4.10.2 on ships xp.jar as xp-1.0.0.jar — copy it as xp.jar. `mvn test` is the full suite and stops here when they are absent or linked. Doctor and the write gate still run without them: mvn -B -Pidm.portable test. See docs/install.md section 2 and bin/require-engine.sh. ${idm.lib}/dirxml.jar ${idm.lib}/dirxml_misc.jar @@ -143,7 +164,7 @@ ${idm.lib}/dhutil.jar ${idm.lib}/XDS.jar ${idm.lib}/js.jar - ${user.home}/.m2/repository/com/pointblue/dirxml/dirxml-simulator/${simulator.version}/dirxml-simulator-${simulator.version}.jar + ${user.home}/.m2/repository/com/pointbluetech/dirxml/dirxml-simulator/${simulator.version}/dirxml-simulator-${simulator.version}.jar @@ -151,6 +172,35 @@ + + + org.codehaus.mojo + flatten-maven-plugin + 1.9.0 + + ossrh + true + + interpolate + remove + + + + + flatten + process-resources + flatten + + + flatten-clean + clean + clean + + + @@ -170,7 +220,7 @@ - com.pointblue.dirxml + com.pointbluetech.dirxml dirxml-simulator ${simulator.version} @@ -249,5 +299,62 @@ + + + central + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.1 + + + attach-sources + jar-no-fork + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.12.0 + + none + true + + + + attach-javadocs + jar + + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.2.8 + + + sign-artifacts + verify + sign + + + + + org.sonatype.central + central-publishing-maven-plugin + 0.12.0 + true + + true + + + + + diff --git a/src/main/java/com/pointblue/dirxml/dev/Doctor.java b/src/main/java/com/pointblue/dirxml/dev/Doctor.java index 3f19e794..7efdc555 100644 --- a/src/main/java/com/pointblue/dirxml/dev/Doctor.java +++ b/src/main/java/com/pointblue/dirxml/dev/Doctor.java @@ -99,7 +99,7 @@ public Path simJar() { } String ver = simVersion == null || simVersion.isBlank() ? PROJECT_SIM_VERSION : simVersion; return Path.of(System.getProperty("user.home"), ".m2", "repository", - "com", "pointblue", "dirxml", "dirxml-simulator", ver, + "com", "pointbluetech", "dirxml", "dirxml-simulator", ver, "dirxml-simulator-" + ver + ".jar"); } @@ -283,9 +283,10 @@ private static Check simulator(Request req) { notes.add("IDM_SIM_VERSION selects " + version + "; this project pins " + PROJECT_SIM_VERSION + "."); } if (!Files.isRegularFile(jar)) { - String detail = "Install the DirXML Simulator and run 'mvn install' in that repo so " - + jar + " exists. The launcher reads IDM_SIM_VERSION (default " + PROJECT_SIM_VERSION - + ", the version in pom.xml). See docs/install.md section 2."; + String detail = "Run bin/install-deps (it installs the pinned simulator), or 'mvn install' in the " + + "DirXMLSimulator repo at that version, so " + jar + " exists. The launcher reads " + + "IDM_SIM_VERSION (default " + PROJECT_SIM_VERSION + ", the version in pom.xml). " + + "See docs/install.md section 2."; notes.add(detail); fields.put("detail", detail); return new Check("simulator", false, "simulator: FAIL " + version + " missing", notes, fields); @@ -295,15 +296,15 @@ private static Check simulator(Request req) { embedded = embeddedVersion(jar); } catch (IOException e) { String detail = jar + " is not a readable dirxml-simulator jar (" + e.getMessage() - + "). Reinstall with 'mvn install' in the DirXMLSimulator repo."; + + "). Reinstall it: bin/install-deps --force simulator."; notes.add(detail); fields.put("detail", detail); return new Check("simulator", false, "simulator: FAIL " + version + " unreadable", notes, fields); } fields.put("jarVersion", embedded == null ? "" : embedded); if (embedded == null) { - String detail = "No META-INF/maven/com.pointblue.dirxml/dirxml-simulator/pom.properties in " + jar - + ". Expected a jar produced by 'mvn install' of dirxml-simulator " + version + "."; + String detail = "No META-INF/maven//dirxml-simulator/pom.properties in " + jar + + ". Expected a dirxml-simulator " + version + " jar (bin/install-deps installs it)."; notes.add(detail); fields.put("detail", detail); return new Check("simulator", false, "simulator: FAIL " + version + " has no simulator version", notes, fields); @@ -642,7 +643,11 @@ static String redact(String message, String secret) { private static String embeddedVersion(Path jar) throws IOException { try (JarFile jf = new JarFile(jar.toFile())) { - JarEntry entry = jf.getJarEntry("META-INF/maven/com.pointblue.dirxml/dirxml-simulator/pom.properties"); + // com.pointbluetech.dirxml from simulator 1.9.0 (Maven Central); com.pointblue.dirxml before. + JarEntry entry = jf.getJarEntry("META-INF/maven/com.pointbluetech.dirxml/dirxml-simulator/pom.properties"); + if (entry == null) { + entry = jf.getJarEntry("META-INF/maven/com.pointblue.dirxml/dirxml-simulator/pom.properties"); + } if (entry == null) { return null; } diff --git a/src/main/java/com/pointblue/dirxml/dev/source/ApplicationType.java b/src/main/java/com/pointblue/dirxml/dev/source/ApplicationType.java index 52d68569..30bfe725 100644 --- a/src/main/java/com/pointblue/dirxml/dev/source/ApplicationType.java +++ b/src/main/java/com/pointblue/dirxml/dev/source/ApplicationType.java @@ -35,7 +35,7 @@ * wrote): the User Application driver is {@code NProv} and the Role and Resource driver * {@code NrfApp} — neither has a driver definition of its own, and Designer's defs map * {@code ComposerDriverShim} to {@code PIVWorkflow}, which is not what it uses. And a SCIM - * driver keeps {@code GenericApp}: {@code test11pf}'s {@code MITLL-Druva} is a + * driver keeps {@code GenericApp}: {@code test11pf}'s Druva driver is a * {@code SCIM-Driver} whose application Designer typed {@code GenericApp}, even though a * {@code SCIM} application type exists. */ diff --git a/src/test/java/com/pointblue/dirxml/dev/DoctorTest.java b/src/test/java/com/pointblue/dirxml/dev/DoctorTest.java index da3bdf9f..68f43307 100644 --- a/src/test/java/com/pointblue/dirxml/dev/DoctorTest.java +++ b/src/test/java/com/pointblue/dirxml/dev/DoctorTest.java @@ -269,6 +269,25 @@ public void endpointDropsUserinfo() { assertEquals("(no url)", Doctor.endpoint(" ")); } + @Test + public void simulatorJarIsReadUnderTheOldAndTheNewGroupId() throws Exception { + for (String groupId : new String[] {"com.pointblue.dirxml", "com.pointbluetech.dirxml"}) { + Doctor.Request req = base(); + writeJars(req.home); + req.simJar = simJar(Doctor.PROJECT_SIM_VERSION, groupId); + String text = Doctor.check(req).text(); + assertTrue(groupId + ": " + text, text.contains("simulator: OK " + Doctor.PROJECT_SIM_VERSION)); + } + } + + @Test + public void theLauncherDefaultIsTheNewGroupIdPath() { + Doctor.Request req = base(); + String path = req.simJar().toString().replace('\\', '/'); + assertTrue(path, path.endsWith("/.m2/repository/com/pointbluetech/dirxml/dirxml-simulator/" + + Doctor.PROJECT_SIM_VERSION + "/dirxml-simulator-" + Doctor.PROJECT_SIM_VERSION + ".jar")); + } + private Doctor.Request ready() throws Exception { Doctor.Request req = base(); writeJars(req.home); @@ -296,10 +315,15 @@ private void writeJars(Path home) throws IOException { } private Path simJar(String version) throws IOException { - Path jar = tmp.getRoot().toPath().resolve("dirxml-simulator-" + version + ".jar"); - String body = "version=" + version + "\ngroupId=com.pointblue.dirxml\nartifactId=dirxml-simulator\n"; + return simJar(version, "com.pointblue.dirxml"); + } + + /** A jar that carries only the pom.properties a simulator jar carries, under that groupId. */ + private Path simJar(String version, String groupId) throws IOException { + Path jar = tmp.getRoot().toPath().resolve("dirxml-simulator-" + version + "-" + groupId + ".jar"); + String body = "version=" + version + "\ngroupId=" + groupId + "\nartifactId=dirxml-simulator\n"; try (JarOutputStream jos = new JarOutputStream(Files.newOutputStream(jar), manifest())) { - JarEntry entry = new JarEntry("META-INF/maven/com.pointblue.dirxml/dirxml-simulator/pom.properties"); + JarEntry entry = new JarEntry("META-INF/maven/" + groupId + "/dirxml-simulator/pom.properties"); jos.putNextEntry(entry); jos.write(body.getBytes(StandardCharsets.UTF_8)); jos.closeEntry(); diff --git a/src/test/java/com/pointblue/dirxml/dev/SyntheticDriverSet.java b/src/test/java/com/pointblue/dirxml/dev/SyntheticDriverSet.java index 1ce11675..8be7724f 100644 --- a/src/test/java/com/pointblue/dirxml/dev/SyntheticDriverSet.java +++ b/src/test/java/com/pointblue/dirxml/dev/SyntheticDriverSet.java @@ -36,7 +36,7 @@ * the generator, which is the reminder to regenerate after a writer change: *
  *   mvn -q -o test-compile
- *   java -cp "target/test-classes:target/classes:lib/*:$HOME/.m2/repository/com/pointblue/dirxml/dirxml-simulator/<ver>/dirxml-simulator-<ver>.jar:<junit-4 jar>:<hamcrest-core jar>" com.pointblue.dirxml.dev.SyntheticDriverSet
+ *   java -cp "target/test-classes:target/classes:lib/*:$HOME/.m2/repository/com/pointbluetech/dirxml/dirxml-simulator/<ver>/dirxml-simulator-<ver>.jar:<junit-4 jar>:<hamcrest-core jar>" com.pointblue.dirxml.dev.SyntheticDriverSet
  * 
*/ public final class SyntheticDriverSet {