Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a40c1fd
fix(ENG-15139): refuse --mavenrc where the mvn script cannot use it
cloudsmith-iduffy Nov 5, 2026
fa48760
fix(ENG-15139): put the Maven extension in the configured local repos…
cloudsmith-iduffy Nov 5, 2026
9ee501f
fix: address review on --mavenrc path checks
cloudsmith-iduffy Nov 5, 2026
f6e0e47
fix: read .mvn/maven.config the way Maven does
cloudsmith-iduffy Nov 5, 2026
418f268
fix: split maven.config on whitespace for Maven before 3.9
cloudsmith-iduffy Nov 5, 2026
fcf20b6
Merge remote-tracking branch 'origin/master' into iduffy/fix-maven-lo…
Copilot Nov 5, 2026
1f609ac
Merge branch 'master' into iduffy/fix-maven-mavenrc-paths
cloudsmith-iduffy Nov 5, 2026
df6bd3a
docs: say where --mavenrc does not work in the CHANGELOG
cloudsmith-iduffy Nov 5, 2026
5cc77b4
Merge remote-tracking branch 'origin/iduffy/fix-maven-mavenrc-paths' …
cloudsmith-iduffy Nov 6, 2026
7dbea59
docs: say the Maven extension goes in the configured local repository
cloudsmith-iduffy Nov 6, 2026
b7ce50c
chore: push again so GitHub picks up the CHANGELOG commit
cloudsmith-iduffy Nov 6, 2026
b054ee3
fix: split MAVEN_OPTS the way mvn and mvn.cmd do
cloudsmith-iduffy Nov 6, 2026
c04f3df
fix: read --define and a split -D in .mvn/maven.config
cloudsmith-iduffy Nov 6, 2026
672497d
fix: resolve placeholders in maven.repo.local of .mvn/maven.config
cloudsmith-iduffy Nov 6, 2026
c282527
fix: resolve maven.config placeholders like Maven and use the mvnw ve…
cloudsmith-iduffy Nov 6, 2026
b1b849f
fix: skip blank lines in maven.config and read the wrapper properties…
cloudsmith-iduffy Nov 6, 2026
8361a1b
fix: refuse --mavenrc when the JAR path has a class path separator
cloudsmith-iduffy Nov 6, 2026
4307905
Merge remote-tracking branch 'origin/iduffy/fix-maven-mavenrc-paths' …
cloudsmith-iduffy Nov 6, 2026
2c93eb6
test: ignore the MAVEN_OPTS of the user in every Maven test
cloudsmith-iduffy Nov 6, 2026
b45c8c4
fix: keep a bare or empty maven.repo.local like Maven
cloudsmith-iduffy Nov 6, 2026
fab25b1
Merge remote-tracking branch 'refs/remotes/origin/master' into iduffy…
Copilot Nov 6, 2026
41ddfa1
fix: report a settings.xml with an unknown encoding as a config error
cloudsmith-iduffy Nov 6, 2026
72bd4d1
fix: handle multi-byte settings.xml encodings and pre-release wrapper…
cloudsmith-iduffy Nov 6, 2026
a3d8f36
refactor: ask Maven for its local repository instead of parsing its c…
cloudsmith-iduffy Nov 6, 2026
71ec789
fix: stop the Maven probe before any goal of the build runs
cloudsmith-iduffy Nov 6, 2026
c038eeb
fix: find the Maven repository line when MAVEN_ARGS turns on color
cloudsmith-iduffy Nov 6, 2026
1df1fdd
fix: run the Maven probe where the user runs the command
cloudsmith-iduffy Nov 6, 2026
25e210f
fix: stop a user-wide Maven install when the local repository is rela…
cloudsmith-iduffy Nov 6, 2026
aa1f36e
fix: detect any relative Maven repository by asking Maven from two di…
cloudsmith-iduffy Nov 6, 2026
96f74c2
fix: use the default repository when the second Maven probe reports n…
cloudsmith-iduffy Nov 6, 2026
7baef90
fix: ask Gradle and sbt where they read the Cloudsmith plugins
cloudsmith-iduffy Nov 6, 2026
fe42bbe
test: do not depend on the order of stdout and stderr
cloudsmith-iduffy Nov 6, 2026
4f99798
fix: report a relative Gradle or sbt path cleanly on uninstall too
cloudsmith-iduffy Nov 6, 2026
7af4239
fix: stop the whole build tool on timeout and keep projects out of th…
cloudsmith-iduffy Nov 6, 2026
81720b8
test: check the timeout stops child processes without process IDs
cloudsmith-iduffy Nov 6, 2026
e9f6abe
fix: warn when a build tool reports nothing, and share the probe flow
cloudsmith-iduffy Nov 6, 2026
bd43e68
fix: stop the build tool on Ctrl+C, and find a broken sbt plugin to r…
cloudsmith-iduffy Nov 6, 2026
4c44a78
fix: anchor reported paths to the probe directory, and fix the Window…
cloudsmith-iduffy Nov 6, 2026
0ae392d
feat: say why install waits for Maven, Gradle, or sbt, and document list
cloudsmith-iduffy Nov 6, 2026
53370d0
Merge branch 'master' into iduffy/fix-maven-local-repository
cloudsmith-iduffy Nov 9, 2026
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
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added

- Added `cloudsmith credential-helper install maven`, `install gradle`, and `install sbt`. They set up the Cloudsmith Maven tools, which get repository credentials from `cloudsmith credential-helper generic`. Each command installs the newest release from the public `cloudsmith/maven-tools` repository, for every build of the user.
- `maven` puts the extension in `~/.m2/repository` and adds it to `~/.m2/extensions.xml`, which Maven 3.10 and later read. When `mvn -v` reports an earlier Maven, the command shows a warning. With `--local`, the command adds the extension to `.mvn/extensions.xml` of the Maven project in the current directory instead. With `--mavenrc`, it adds a block to `~/.mavenrc` instead, which the `mvn` and `mvnw` scripts of all Maven versions read. `--mavenrc` does not work on Windows or when the path of the local Maven repository contains a space or a `:`. In these cases the command stops and tells you to use `--local` or Maven 3.10.
- `gradle` writes an init script to `~/.gradle/init.d` (or `$GRADLE_USER_HOME/init.d`), which applies the plugin to every Gradle build.
- `sbt` writes a global plugin to `~/.sbt/1.0/plugins`, which adds the plugin to every sbt 1 build. With `--local`, it writes `project/cloudsmith.sbt` of the sbt project in the current directory instead.
- `maven` puts the extension in the local repository that Maven reports (`~/.m2/repository` when the command cannot run `mvn`) and adds it to `~/.m2/extensions.xml`, which Maven 3.10 and later read. When `mvn -v` reports an earlier Maven, the command shows a warning. With `--local`, the command adds the extension to `.mvn/extensions.xml` of the Maven project in the current directory instead. With `--mavenrc`, it adds a block to `~/.mavenrc` instead, which the `mvn` and `mvnw` scripts of all Maven versions read. `--mavenrc` does not work on Windows or when the path of the local Maven repository contains a space or a `:`. In these cases the command stops and tells you to use `--local` or Maven 3.10.
- `gradle` writes an init script to `init.d` of the Gradle user home that `gradle` reports (`$GRADLE_USER_HOME` or `~/.gradle` when the command cannot run `gradle`), which applies the plugin to every Gradle build.
- `sbt` writes a global plugin to the global plugins directory that `sbt` reports (`~/.sbt/1.0/plugins` when the command cannot run `sbt`), which adds the plugin to every sbt 1 build. With `--local`, it writes `project/cloudsmith.sbt` of the sbt project in the current directory instead.
- To find these locations, the commands run Maven, Gradle or sbt, which can take a few seconds. The commands show a message while they wait. When Maven, Gradle or sbt reports a relative path for these locations, the command stops, because each build would look in its own directory.
- `credential-helper list` checks only the default locations of Gradle and sbt, so a location that `gradle.user.home` or `sbt.global.base` moves shows as not installed.
- The commands add to existing files and keep their other content. `uninstall` removes only what `install` added.

- Added `skills` to `cloudsmith upstream`. Use `cloudsmith upstream skills list`, `create`, `update`, and `delete` to manage AI Skills upstreams. An AI Skills upstream caches skills and plugins from a GitHub repository.
Expand Down
24 changes: 23 additions & 1 deletion cloudsmith_cli/cli/commands/credential_helper/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from __future__ import annotations

import sys
from functools import partial
from urllib.parse import urlsplit

import click
Expand All @@ -25,6 +26,7 @@
MavenrcNotSupported,
)
from cloudsmith_cli.credential_helpers.maven_tools import (
BuildToolError,
ConfigFileConflict,
ProjectNotFound,
)
Expand Down Expand Up @@ -212,7 +214,7 @@
contexts = []
while ctx is not None:
contexts.insert(0, ctx)
ctx = ctx.parent

Check failure on line 217 in cloudsmith_cli/cli/commands/credential_helper/manage.py

View workflow job for this annotation

GitHub Actions / ty

ty (invalid-assignment)

cloudsmith_cli/cli/commands/credential_helper/manage.py:217:15: invalid-assignment: Object of type `Context | None` is not assignable to `Context` cloudsmith_cli/cli/commands/credential_helper/manage.py:204:38: Declared type info: element `None` of union `Context | None` is not assignable to `Context`

supplied = (ParameterSource.COMMANDLINE, ParameterSource.ENVIRONMENT)
settings = {}
Expand Down Expand Up @@ -438,6 +440,7 @@

if getattr(installer, "KEEPS_INSTALL_TIME_SETTINGS", False):
install_kwargs["launcher_env"] = _launcher_settings_from_cli(ctx)
install_kwargs.update(_progress_option(installer))

try:
actions = installer.install(**install_kwargs)
Expand All @@ -451,6 +454,7 @@
ConfigFileConflict,
UnsafeLauncherValue,
MavenrcNotSupported,
BuildToolError,
) as exc:
raise click.ClickException(str(exc))
except OSError as exc:
Expand Down Expand Up @@ -550,8 +554,14 @@
bin_dir=bin_dir,
dry_run=dry_run,
**_helper_options(ctx, helper),
**_progress_option(installer),
)
except (ConfigFileParseError, ProjectNotFound, ConfigFileConflict) as exc:
except (
ConfigFileParseError,
ProjectNotFound,
ConfigFileConflict,
BuildToolError,
) as exc:
raise click.ClickException(str(exc))
except OSError as exc:
raise click.ClickException(
Expand All @@ -578,6 +588,13 @@
click.secho(f" {warning}" if dry_run else warning, err=True, fg="yellow")


def _progress_option(installer) -> dict:
"""Return the callback that says why the command waits, for an installer that asks a build tool."""
if getattr(installer, "ASKS_BUILD_TOOL", False):
return {"progress": partial(click.echo, err=True)}
return {}


# ---------------------------------------------------------------------------
# list
# ---------------------------------------------------------------------------
Expand All @@ -593,6 +610,11 @@
Shows which helpers are available, whether their launcher binary is
present on PATH, and which registry hosts they are configured for.

For gradle and sbt, list checks only the default locations: init.d in
$GRADLE_USER_HOME or ~/.gradle, and ~/.sbt/1.0/plugins. Install and
uninstall ask Gradle and sbt where they read plugins. If gradle.user.home
or sbt.global.base moves that location, list shows "not installed".

Example:

\b
Expand Down
Loading
Loading