Enum EnvironmentVariable

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<EnvironmentVariable>

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

      Enum Constants 
      Enum Constant Description
      FORCE_COLOR
      If set to any value, force enables the support of ANSI colors in the output.
      NO_COLOR
      If set to any value, disable ANSI colors in the output.
      SMITHY_DEPENDENCY_MODE
      Configures if and how the Smithy CLI handles dependencies declared in smithy-build.json files.
      SMITHY_MAVEN_CACHE
      A custom location for the Maven local repository cache.
      SMITHY_MAVEN_REPOS
      A pipe-delimited list of Maven repositories to use.
      SMITHY_PROXY_CREDENTIALS
      Used to determine a proxy credentials to use for Maven dependency resolution through a proxy.
      SMITHY_PROXY_HOST
      Used to determine a proxy host to use for Maven dependency resolution.
      SMITHY_VERSION
      The current version of the CLI.
      TERM
      Used to detect if ANSI colors are supported.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clears the system property for the variable.
      java.lang.String get()
      Gets the system property or the environment variable for the property, in that order.
      static java.lang.String getByName​(java.lang.String name)
      Gets a system property or environment variable by name, in that order.
      boolean isSet()
      Returns true if the system property or environment variables is set.
      void set​(java.lang.String value)
      Sets a system property for the environment variable.
      static EnvironmentVariable valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static EnvironmentVariable[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • 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 Detail

      • values

        public static EnvironmentVariable[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (EnvironmentVariable c : EnvironmentVariable.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static EnvironmentVariable valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getByName

        public static java.lang.String getByName​(java.lang.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 java.lang.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​(java.lang.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.