Enum Class EnvironmentVariable

java.lang.Object
java.lang.Enum<EnvironmentVariable>
software.amazon.smithy.cli.EnvironmentVariable
All Implemented Interfaces:
Serializable, Comparable<EnvironmentVariable>, Constable

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

    • SMITHY_MAVEN_CACHE

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

      Example: ~/.m2/repository

    • SMITHY_MAVEN_REPOS

      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

    • SMITHY_DEPENDENCY_MODE

      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.

    • SMITHY_VERSION

      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.
    • FORCE_COLOR

      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.
    • SMITHY_PROXY_HOST

      public static final EnvironmentVariable SMITHY_PROXY_HOST
      Used to determine a proxy host to use for Maven dependency resolution.

      Set the host, protocol, and port information with a valid url.

       export SMITHY_PROXY_HOST=protocol://host:port
       
      NOTE: this setting will be used for all repositories defined in the smithy-build maven configuration unless a repo-specific configuration is provided.
    • SMITHY_PROXY_CREDENTIALS

      public static final EnvironmentVariable SMITHY_PROXY_CREDENTIALS
      Used to determine a proxy credentials to use for Maven dependency resolution through a proxy.

      Use this setting in conjunction with the SMITHY_PROXY_HOST variable to configure proxy settings for dependency resolution.

      Set both the username and password information as a ":" separated string.

       export SMITHY_PROXY_CREDENTIALS=user:pass
       
      NOTE: this setting will be used for all repositories defined in the smithy-build maven configuration unless a repo-specific configuration is provided.
  • Method Details

    • values

      public static EnvironmentVariable[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      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.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      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.
      Parameters:
      name - Variable to get.
      Returns:
      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:
      Returns true if set.
    • get

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

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

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