Enum Class EnvironmentVariable

All Implemented Interfaces:
Serializable, Comparable<EnvironmentVariable>, Constable

public enum EnvironmentVariable extends Enum<EnvironmentVariable>
Environment variables used by the Smithy CLI.
  • Enum Constant Details


      public static final EnvironmentVariable SMITHY_MAVEN_CACHE
      A custom location for the Maven local repository cache.

      Example: ~/.m2/repository


      public static final EnvironmentVariable SMITHY_MAVEN_REPOS
      A pipe-delimited list of Maven repositories to use.

      Example: https://example.com/repo1|https://example.com/repo2


      public static final EnvironmentVariable SMITHY_DEPENDENCY_MODE
      Configures if and how the Smithy CLI handles dependencies declared in smithy-build.json files.
      • ignore: ignore dependencies and assume that they are provided by the caller of the CLI.
      • forbid: forbids dependencies from being declared and will fail the CLI if dependencies are declared.
      • standard: the assumed default, will automatically resolve dependencies using Apache Maven.

      If the CLI detects that Gradle is calling the CLI, dependency resolution is disabled and defaults to ignore. You can explicitly enable dependency resolution by setting SMITHY_DEPENDENCY_MODE to standard.


      public static final EnvironmentVariable SMITHY_VERSION
      The current version of the CLI. This is set automatically by the CLI.
    • NO_COLOR

      public static final EnvironmentVariable NO_COLOR
      If set to any value, disable ANSI colors in the output.

      public static final EnvironmentVariable FORCE_COLOR
      If set to any value, force enables the support of ANSI colors in the output.
    • TERM

      public static final EnvironmentVariable TERM
      Used to detect if ANSI colors are supported.
      • If set to "dumb" colors are disabled.
      • If not set and the operating system is detected as Windows, colors are disabled.
  • Method Details

    • values

      public static EnvironmentVariable[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static EnvironmentVariable valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      name - the name of the enum constant to be returned.
      the enum constant with the specified name
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getByName

      public static String getByName(String name)
      Gets a system property or environment variable by name, in that order.
      name - Variable to get.
      Returns the found system property or environment variable or null.
    • isSet

      public boolean isSet()
      Returns true if the system property or environment variables is set.
      Returns true if set.
    • get

      public String get()
      Gets the system property or the environment variable for the property, in that order.
      Returns the found system property or environment variable or null.
    • set

      public void set(String value)
      Sets a system property for the environment variable.
      value - Value to set.
    • clear

      public void clear()
      Clears the system property for the variable.