Configuration
jgo is configured through a combination of settings files, environment variables, command-line flags, and jgo.toml project files.
Settings file
The global settings file uses INI format. jgo checks these locations in order:
~/.config/jgo.conf(XDG Base Directory standard – recommended)~/.jgorc(legacy location, still supported)
If both exist, the XDG location takes precedence.
Format
[settings]
cacheDir = ~/.cache/jgo
m2Repo = ~/.m2/repository
links = hard
[repositories]
scijava.public = https://maven.scijava.org/content/groups/public
[shortcuts]
imagej = net.imagej:imagej
fiji = sc.fiji:fiji:LATEST
jython = org.python:jython-standalone
repl = imagej:org.scijava.script.ScriptREPL
[settings] section
cacheDirRoot directory for cached environments. Default:
~/.cache/jgo.m2RepoLocal Maven repository cache. Default:
~/.m2/repository.linksLink strategy for JARs:
hard,soft,copy, orauto. Default:hard.
[repositories] section
Additional remote Maven repositories. Maven Central is always included. Each entry is name = URL:
[repositories]
scijava.public = https://maven.scijava.org/content/groups/public
myrepo = https://repo.example.com/maven2
You can also pass repositories on the command line with -r:
jgo -r scijava=https://maven.scijava.org/content/groups/public org.scijava:parsington
Tip
For more control over Maven repository configuration (mirrors, authentication), use Maven’s ~/.m2/settings.xml. See Using Mirrors for Repositories.
[shortcuts] section
Shortcuts are aliases that expand to Maven coordinates. They replace the matched prefix at the beginning of an endpoint string:
[shortcuts]
imagej = net.imagej:imagej
fiji = sc.fiji:fiji:LATEST
repl = imagej:org.scijava.script.ScriptREPL
Usage:
jgo imagej # Expands to: net.imagej:imagej
jgo imagej:2.15.0 # Expands to: net.imagej:imagej:2.15.0
jgo repl # Expands to: net.imagej:imagej with main class
jgo repl+groovy # Combines multiple shortcuts
Shortcut rules:
Shortcuts match at the start of a coordinate (or each
+-separated part).Anything after the matched name is preserved (e.g.,
imagej:2.0.0keeps:2.0.0).Shortcuts can reference other shortcuts and are expanded recursively.
Composition with
+treats each part independently.
Managing shortcuts from the CLI:
jgo config shortcut # List all shortcuts
jgo config shortcut imagej # Show expansion
jgo config shortcut imagej net.imagej:imagej # Add/update
jgo config shortcut --remove imagej # Remove
Environment variables
Variable |
Description |
Equivalent flag |
|---|---|---|
|
Override cache directory |
|
|
Override Maven repository location |
|
|
Java installation (when using system Java) |
|
|
Force specific Java version |
|
|
Work offline |
|
|
Update cached environment |
|
|
Skip cache |
|
|
Warn instead of fail on unresolved deps |
|
|
Include optional dependencies |
|
|
Output color mode |
|
Precedence
Configuration is merged with this precedence (highest to lowest):
Command-line flags (
--cache-dir,-r, etc.)Environment variables (
JGO_CACHE_DIR, etc.)jgo.tomlsettings (in project mode)Settings file (
~/.config/jgo.confor~/.jgorc)Built-in defaults