[46:6] static extends: object
Enum defines how a jar build handles an entry that appears in more
than one input. first keeps the first seen, last the last, and
error fails the build on a conflict.
[68:6] static extends: object
Enum defines the Javadoc visibility levels. protectedApi is
Javadoc's own default (public and protected members); publicApi
narrows to public only, and packageApi / privateApi widen to
include more.
[330:7] extends: object
JavaJar carries the full set of packaging inputs for
JavaTools.jar.
The simple jar call covers a library jar and an executable jar. The
thin, uber, and shaded kinds add enough options - bundled jars,
duplicate handling, relocation, manifest headers, filters - that a
flat argument list would be unwieldy, so they live here.
inputDir (InputDir)
Sets the directory holding the class files and resources to package.
InputDir is a directory path, or a list of directories to merge.this object for chaining.output (string Output)
Sets the jar path to write.
Output is the output jar path.this object for chaining.mainClass (string MainClass)
Sets the Main-Class manifest header, which makes the jar executable.
MainClass is the fully qualified main class name.this object for chaining.manifest (map Manifest)
Sets extra manifest headers.
Manifest is a map of header name to value.this object for chaining.classpath (list Classpath)
Sets the jars written as a Class-Path header, producing a thin jar that points at external jars rather than bundling them.
Classpath is a list of jar paths.this object for chaining.includes (list Includes)
Sets glob patterns selecting which entries to include. When unset every entry is included.
Includes is a list of glob patterns.this object for chaining.excludes (list Excludes)
Sets glob patterns selecting which entries to drop, for example to strip a module-info.class.
Excludes is a list of glob patterns.this object for chaining.bundle (list Bundle)
Sets dependency jars whose entries are inlined, producing a self-contained uber jar.
Bundle is a list of jar paths.this object for chaining.duplicates (string Strategy)
Sets how an entry appearing in more than one input is handled.
Strategy is the strategy string. (enum duplicateStrategy)this object for chaining.mergeServices (bool Merge)
Sets whether META-INF/services/* files from bundled jars are concatenated rather than overwritten. True by default, so service-provider entries from every bundled jar survive.
Merge is true to concatenate service files.this object for chaining.stripSignatures (bool Strip)
Sets whether signature files from bundled jars are dropped. True by default, since they no longer match the merged archive and would fail verification.
Strip is true to drop signature files.this object for chaining.relocate (string From, string To)
Adds a package-prefix rename rule; call it again for more rules. Every reference to the From package - in class bytecode, resource paths, and service files - is rewritten to To. Relocation turns an uber jar into a shaded jar, letting an application bundle its own copy of a library without colliding with a different version elsewhere on the classpath.
From is the package prefix to rename.To is the replacement package prefix.this object for chaining.toMap ()
Converts this options object to the map the backing implementation reads. Called by
JavaTools.jar.
A map with the jar inputs.[81:6] static extends: object
Enum defines the jpackage output kinds. Each member maps to jpackage's
own --type value; only appImage differs from the tool's spelling
(app-image). appImage produces a native app image directory; the
rest produce platform installers and need that platform's tooling.
[817:7] extends: object
JavaPackage carries the full set of inputs for JavaTools.jpackage.
jpackage turns an application plus a runtime into a native app image or
a platform installer. The simple jpackage call covers the common
case (type, name, input directory, main jar and class); this options
object adds the metadata, runtime, and platform controls.
type (string Type)
Sets the output kind (jpackage --type).
Type is the type string. (enum packageType)this object for chaining.name (string Name)
Sets the application name (jpackage --name).
Name is the application name.this object for chaining.inputDir (string InputDir)
Sets the input directory holding the application jars (jpackage --input).
InputDir is the input directory path.this object for chaining.mainJar (string MainJar)
Sets the launched jar (jpackage --main-jar), relative to the input directory.
MainJar is the main jar file name.this object for chaining.mainClass (string MainClass)
Sets the application main class (jpackage --main-class).
MainClass is the fully qualified main class name.this object for chaining.appVersion (string Version)
Sets the application version (jpackage --app-version).
Version is the version string.this object for chaining.dest (string Dest)
Sets the output directory (jpackage --dest). Defaults to "build/jpackage" when unset.
Dest is the output directory path.this object for chaining.vendor (string Vendor)
Sets the vendor (jpackage --vendor).
Vendor is the vendor name.this object for chaining.description (string Description)
Sets the description (jpackage --description).
Description is the description text.this object for chaining.copyright (string Copyright)
Sets the copyright (jpackage --copyright).
Copyright is the copyright text.this object for chaining.icon (string Icon)
Sets the application icon (jpackage --icon).
Icon is the icon file path.this object for chaining.runtimeImage (string RuntimeImage)
Sets the runtime image (jpackage --runtime-image). When unset, jpackage reuses the selected JDK's runtime rather than running its own internal jlink. Pass a jlink output for a slimmer runtime.
RuntimeImage is the runtime image directory path.this object for chaining.javaOption (string Option)
Adds a JVM option for the launched application (jpackage --java-options). Call it again for more.
Option is the JVM option to pass.this object for chaining.addLauncher (string Name, string PropsPath)
Adds an extra launcher (jpackage --add-launcher). Call it again for more.
Name is the launcher name.PropsPath is the path to the launcher's properties file.this object for chaining.fileAssociation (string PropsPath)
Adds a file-association properties file (jpackage --file-associations). Call it again for more.
PropsPath is the path to the association's properties file.this object for chaining.linuxShortcut (bool Shortcut)
Sets whether to add a Linux shortcut (jpackage --linux-shortcut).
Shortcut is true to add a shortcut.this object for chaining.winConsole (bool Console)
Sets whether to launch with a console on Windows (jpackage --win-console).
Console is true to launch with a console.this object for chaining.winShortcut (bool Shortcut)
Sets whether to add a Windows shortcut (jpackage --win-shortcut).
Shortcut is true to add a shortcut.this object for chaining.winMenu (bool Menu)
Sets whether to add a Windows Start menu entry (jpackage --win-menu).
Menu is true to add a menu entry.this object for chaining.macPackageIdentifier (string Identifier)
Sets the macOS package identifier (jpackage --mac-package-identifier).
Identifier is the package identifier.this object for chaining.macPackageName (string Name)
Sets the macOS package name (jpackage --mac-package-name).
Name is the package name.this object for chaining.arg (string Arg)
Adds a raw jpackage flag. The escape hatch for any flag not modeled.
Arg is the flag to pass through.this object for chaining.toMap ()
Converts this options object to the map the backing implementation reads. Called by
JavaTools.jpackage.
A map with the jpackage inputs.[23:6] static extends: object
Enum defines the annotation processing modes for a compile.
full compiles and processes, only processes without compiling,
and none compiles with no processing.
[10:6] static extends: object
Enum defines where a discovered JDK was found. Each member evaluates
to its own name as a string, so it can be compared directly against
the source field of a detectJdks entry.
[513:7] extends: object
JavaDoc carries the full set of documentation inputs for
JavaTools.javadoc, for callers who need more than the inline form's
sources, output directory, and classpath.
sources (list Sources)
Sets the source files or directories to document.
Sources is a list of paths.this object for chaining.outputDir (string OutputDir)
Sets the HTML output directory.
OutputDir is the output directory path.this object for chaining.classpath (list Classpath)
Sets the classpath, letting Javadoc resolve types the code refers to.
Classpath is a list of jars and directories.this object for chaining.modulePath (list ModulePath)
Sets the module path. A modular project - one with a module-info.java - needs its dependencies here so Javadoc can resolve the module's
requires, the same way javac does.
ModulePath is a list of jars and directories.this object for chaining.windowTitle (string Title)
Sets the browser window title.
Title is the window title text.this object for chaining.docTitle (string Title)
Sets the documentation overview title.
Title is the doc title text.this object for chaining.link (string Url)
Adds a -link cross-reference to another API's documentation; call it again for more.
Url is the documentation URL to link against.this object for chaining.doclet (string Doclet)
Sets a custom doclet class.
Doclet is the doclet class name.this object for chaining.visibility (string Visibility)
Sets which members are documented.
Visibility is the visibility string. (enum docVisibility)this object for chaining.arg (string Arg)
Adds a raw javadoc flag. This is the escape hatch for any flag not modeled by a setter.
Arg is the flag to pass through.this object for chaining.jdk (string Jdk)
Overrides the configured JDK for this run only.
Jdk is the JDK home path.this object for chaining.toMap ()
Converts this options object to the map the backing implementation reads. Called by
JavaTools.javadoc.
A map with the javadoc inputs.[1125:14] (extern: com.lehman.aussom.stdlib.AussomJavaTools) extends: object
JavaTools lets Aussom code compile Java source, package class files
into a jar of any kind, generate Javadoc, and resolve Maven
dependencies.
It is an instantiable object rather than a static class because a
caller usually sets configuration once - which JDK, which Maven
repositories, where the local repository lives - and then runs several
operations against it.
By default it uses the system JDK - the one the developer's own shell
compiles with (JAVA_HOME, else javac on the PATH) - so a build script
uses the JDK the user expects rather than Aussom's bundled runtime. It
falls back to the JDK that ships with Aussom when no system JDK is
found. A system or specific JDK runs that JDK's tools as a subprocess,
while the shipped JDK compiles in-process (with structured diagnostics),
because the in-process compiler is always the running JVM's own.
JavaTools ()
Constructor creates a new JavaTools object configured with the system JDK (falling back to the shipped JDK) and Maven Central.
newJavaTools ()
useShippedJdk ()
Selects the JDK that ships with Aussom, the fallback default. It compiles in-process and yields structured diagnostics.
This object.useSystemJdk ()
Selects the system JDK: JAVA_HOME when set, otherwise javac on the PATH. Compiles as a subprocess against that JDK.
This object.useJdk (string JdkHome)
Selects a specific JDK by home path. Compiles as a subprocess against that JDK.
JdkHome is the JDK home directory, meaning the directory that contains bin/javac.This object.useSubprocess (bool Force = true)
Forces the subprocess path even for the shipped JDK, for callers who want the isolation of a separate process.
Force is true to always run tools as a subprocess.This object.getJdkHome ()
Gets the currently selected JDK home.
A string with the JDK home path.setLocalRepo (string Path)
Sets the Maven local repository directory. When unset, resolution falls back to the detected one, so it uses the caller's existing ~/.m2 cache by default.
Path is the local repository path.This object.addRepo (string Id, string Url)
Adds a remote Maven repository. Call it again for more.
Id is the repository id, such as "central".Url is the repository base URL.This object.clearRepos ()
Clears the configured remote repositories, including the default Maven Central entry. Lets a caller resolve from only their own repositories.
This object.detectJdks ()
Discovers every installed JDK found on this machine, newest first. Discovery is best effort and never fails the build; it returns what it can find, and the explicit setters remain the reliable fallback for anything it misses.
A list of maps, each with home, version, vendor, hasCompiler, and source. (enum jdkSource)detectLocalRepo ()
Finds the Maven local repository the way Maven itself resolves it: the maven.repo.local system property, then a localRepository element in ~/.m2/settings.xml, then the default <user.home>/.m2/repository. The default is returned even when the directory does not exist yet, since a resolve will create it.
A string with the local repository path.useDetectedJdk ()
Picks a discovered JDK and configures it in one step. Prefers JAVA_HOME when that is a valid JDK, otherwise the newest discovered version that has a compiler, and always falls back to the shipped JDK when discovery comes up empty.
A map describing the JDK it chose.compile (Sources, string OutputDir = "build/classes", list Classpath = null, int Release = null)
Compiles Java source to class files. The everyday case is a short call:
jt.compile(["src"])compiles everything under src to build/classes at the JDK's own release. For the longer tail of javac inputs, pass aJavaCompileoptions object as the only argument instead.
Sources is a list of .java files or directories, or a JavaCompile options object carrying the full input set.OutputDir is where class files are written. Defaults to "build/classes". Ignored when Sources is a JavaCompile.Classpath is a list of jars and directories for the compile classpath; a classpath from resolve drops straight in. Ignored when Sources is a JavaCompile.Release is the Java feature release. Defaults to null, meaning match the selected JDK. Ignored when Sources is a JavaCompile.A map with success and diagnostics, each diagnostic carrying kind (enum diagnosticKind), file, line, column, and message. A subprocess compile also carries exitCode, stdout, and stderr.compileEx (map Spec)
javadoc (Sources, string OutputDir = "build/docs", list Classpath = null)
Generates HTML API documentation from source. Packaging the docs is then just a
jarover the output, which matches the Maven -javadoc and -sources artifact convention.
Sources is a list of .java files or directories, or a JavaDoc options object carrying the full input set.OutputDir is the HTML output directory. Defaults to "build/docs". Ignored when Sources is a JavaDoc.Classpath is a list of jars and directories letting Javadoc resolve types the code refers to. Ignored when Sources is a JavaDoc.A map with success and the diagnostics the tool produced.javadocEx (map Spec)
jar (InputDir, string Output = null, string MainClass = null)
Packages class files into a jar. A library jar needs only the input tree and the output path; adding a main class makes it executable. For the thin, uber, and shaded kinds, pass a
JavaJaroptions object as the only argument instead.
InputDir is a directory string, a list of directories to merge, or a JavaJar options object carrying the full input set.Output is the jar path to write. Ignored when InputDir is a JavaJar.MainClass is the Main-Class header, which makes the jar executable. Defaults to null. Ignored when InputDir is a JavaJar.A map with success, jarPath, entryCount, jarsBundled, and relocationsApplied.jarEx (map Spec)
jarList (string JarPath)
Gets the entry names in a jar.
JarPath is the jar to read.A list of strings with the entry names.jarEntries (string JarPath)
Gets per-entry detail for a jar, for inspecting an archive without unpacking it.
JarPath is the jar to read.A list of maps, each with name, size, compressedSize, isDirectory, and time.jarRead (string JarPath, string EntryName)
Reads a single entry's contents out of a jar without extracting the whole thing.
JarPath is the jar to read.EntryName is the entry to read.A Buffer object with the entry's bytes.jarManifest (string JarPath)
Gets a jar's manifest headers.
JarPath is the jar to read.A map of manifest header name to value.jarExtract (string JarPath, string DestDir, list Globs = null)
Unpacks a jar's entries into a directory.
JarPath is the jar to unpack.DestDir is the directory to write into.Globs is an optional list of glob patterns limiting what is written. Defaults to null, meaning every entry.An int with the number of entries written.jarPut (string JarPath, string EntryName, Data)
Adds an entry to a jar, or replaces it when the name already exists. Keeps META-INF/MANIFEST.MF first and leaves the manifest intact.
JarPath is the jar to edit.EntryName is the entry to add or replace.Data is a string or Buffer object with the entry's contents.true on success.jarReplace (string JarPath, string EntryName, Data)
Replaces an existing entry in a jar. Same as
jarPutbut fails when the entry is absent, for callers who want that check.
JarPath is the jar to edit.EntryName is the entry to replace.Data is a string or Buffer object with the entry's contents.true on success.jarPutEx (string JarPath, string EntryName, Data, bool MustExist)
jarRemove (string JarPath, string EntryName)
Removes an entry from a jar.
JarPath is the jar to edit.EntryName is the entry to drop.true on success.resolve (Coordinates, string Scope = "compile", bool Transitive = true)
Resolves a Maven artifact and its transitive dependencies and returns the local jar paths - the classpath a compile or a jar step needs. The remote repositories and local cache are set once on the object with
addRepoandsetLocalRepo, so this call stays short.
Coordinates is a single "group:artifact:version" string, or a list of them.Scope is which transitive dependencies to include. Defaults to "compile". (enum resolveScope)Transitive is true by default; false resolves only the named artifacts.A map with success, classpath (the resolved jar paths), and artifacts (each with coordinate and path).jlink (Modules, string Output = null, list ModulePath = null)
Builds a custom Java runtime image with jlink, holding only the modules an application needs. The everyday case is a short call with the root modules and an output directory. For the fuller set, pass a
JavaLinkoptions object as the only argument instead.
Modules is a list of root module names, or a JavaLink options object carrying the full input set.Output is the image directory to write; it must not already exist. Ignored when Modules is a JavaLink.ModulePath is a list of module jars and directories for non-JDK modules. Ignored when Modules is a JavaLink.A map with success, imagePath, exitCode, stdout, and stderr.jlinkEx (map Spec)
jpackage (Type, string Name = null, string InputDir = null, string MainJar = null, string MainClass = null)
Builds a native app image or platform installer with jpackage. The everyday case is a short call with the type, name, input directory, main jar, and main class. For the fuller set, pass a
JavaPackageoptions object as the only argument instead. By default jpackage reuses the selected JDK's runtime rather than running its own internal jlink.
Type is the output kind (enum packageType), or a JavaPackage options object carrying the full input set.Name is the application name. Ignored when Type is a JavaPackage.InputDir is the directory holding the application jars (--input). Ignored when Type is a JavaPackage.MainJar is the launched jar (--main-jar). Ignored when Type is a JavaPackage.MainClass is the main class (--main-class). Defaults to null. Ignored when Type is a JavaPackage.A map with success, packagePath, exitCode, stdout, and stderr.jpackageEx (map Spec)
install (string Group, string Artifact, string Version, string JarPath, string PomPath = null, string SourcesPath = null, string JavadocPath = null)
Installs a built jar and its companion artifacts into the local Maven repository, so other projects on the same machine can resolve it as a dependency. The POM, sources jar, and javadoc jar are optional; pass null to skip one. The install always runs; it does not skip when the same version is already present, so re-installing a version needs no bump and no manual delete from the repository.
Group is the Maven groupId.Artifact is the Maven artifactId.Version is the Maven version.JarPath is the main jar to install.PomPath is the POM file to install, or null.SourcesPath is the sources jar to install, or null.JavadocPath is the javadoc jar to install, or null.A map with success and, on failure, a message.[57:6] static extends: object
Enum defines which transitive dependencies a resolve includes.
compile is the set needed to compile against the artifact and
runtime is the set needed to run it.
[96:6] static extends: object
Enum defines the jlink compression level, mapping each member to
jlink's --compress value: zip0 is no compression through zip9 for
the best compression. jlink's own default is zip6 when unset.
[671:7] extends: object
JavaLink carries the full set of inputs for JavaTools.jlink.
jlink builds a minimal Java runtime holding only the modules an
application needs. The simple jlink call covers the common case
(root modules and an output directory); this options object adds the
size and launcher controls.
modules (list Modules)
Sets the root modules to include (jlink --add-modules).
Modules is a list of module names.this object for chaining.output (string Output)
Sets the image output directory (jlink --output). It must not already exist.
Output is the image directory path.this object for chaining.modulePath (list ModulePath)
Sets the module path for non-JDK modules (jlink --module-path). A classpath from
resolveof modular jars drops in here.
ModulePath is a list of module jars and directories.this object for chaining.stripDebug (bool Strip)
Sets whether to strip debug information (jlink --strip-debug).
Strip is true to strip debug info.this object for chaining.noHeaderFiles (bool NoHeaders)
Sets whether to omit header files (jlink --no-header-files).
NoHeaders is true to omit header files.this object for chaining.noManPages (bool NoMan)
Sets whether to omit man pages (jlink --no-man-pages).
NoMan is true to omit man pages.this object for chaining.bindServices (bool Bind)
Sets whether to bind service providers (jlink --bind-services), so ServiceLoader users like java.logging are included.
Bind is true to bind services.this object for chaining.compress (string Compress)
Sets the compression level (jlink --compress).
Compress is the level string. (enum linkCompress)this object for chaining.launcher (string Name, string Module)
Adds a launcher script to the image (jlink --launcher). Call it again for more launchers.
Name is the launcher command name.Module is the module (or module/mainclass) to launch.this object for chaining.arg (string Arg)
Adds a raw jlink flag. The escape hatch for any flag not modeled.
Arg is the flag to pass through.this object for chaining.toMap ()
Converts this options object to the map the backing implementation reads. Called by
JavaTools.jlink.
A map with the jlink inputs.[33:6] static extends: object
Enum defines the compiler diagnostic kinds. The values match the Java compiler's own Diagnostic.Kind names.
[120:7] extends: object
JavaCompile carries the full set of compilation inputs for
JavaTools.compile.
Aussom arguments are positional, so compile takes only the everyday
knobs directly. The longer tail of javac inputs - annotation
processing, modular builds, encoding, extra flags, a per-call JDK
override - would make an unwieldy argument list, so they live here.
Every setter is typed and optional; an unset one keeps the same
default as the inline form.
sources (list Sources)
Sets the source files or directories to compile. Directories are walked for .java files.
Sources is a list of paths.this object for chaining.outputDir (string OutputDir)
Sets where class files are written (javac -d).
OutputDir is the output directory path.this object for chaining.classpath (list Classpath)
Sets the compile classpath. A classpath from
resolvedrops straight in.
Classpath is a list of jars and directories.this object for chaining.release (int Release)
Sets the Java feature release (javac --release N). When unset the build matches the selected JDK's own release.
Release is the feature release number.this object for chaining.encoding (string Encoding)
Sets the source file encoding.
Encoding is the encoding name, such as "UTF-8".this object for chaining.processorPath (list ProcessorPath)
Sets the annotation processor path. An annotation processor is a plugin javac runs during compilation to read annotations and generate more source or classes.
ProcessorPath is a list of jars holding processors.this object for chaining.processors (list Processors)
Names which annotation processors to run.
Processors is a list of processor class names.this object for chaining.proc (string Proc)
Sets the annotation processing mode.
Proc is the mode string. (enum procMode)this object for chaining.modulePath (list ModulePath)
Sets the JPMS module path. A project with a module-info.java compiles against the module path rather than the classpath.
ModulePath is a list of module jars and directories.this object for chaining.addModules (list AddModules)
Adds root modules to resolve (javac --add-modules).
AddModules is a list of module names.this object for chaining.addExports (string Export)
Adds a module export (javac --add-exports).
Export is an export spec such as "java.base/jdk.internal.module=ALL-UNNAMED".this object for chaining.addReads (string Read)
Adds a module read edge (javac --add-reads).
Read is a read spec such as "mymod=ALL-UNNAMED".this object for chaining.patchModule (string Patch)
Adds a module patch (javac --patch-module).
Patch is a patch spec such as "mymod=src/patch".this object for chaining.arg (string Arg)
Adds a raw javac flag. This is the escape hatch for any flag not modeled by a setter.
Arg is the flag to pass through.this object for chaining.jdk (string Jdk)
Overrides the configured JDK for this build only.
Jdk is the JDK home path.this object for chaining.toMap ()
Converts this options object to the map the backing implementation reads. Called by
JavaTools.compile.
A map with the compile inputs.