<commit_before>[[howto]]
= '`How-to`' guides

[partintro]
--
This section provides answers to some common '`how do I do that...`' type of questions
that often arise when using Spring Cloud Data Flow. This is by no means an exhaustive list, but it
does cover quite a lot.

If you are having a specific problem that we don't cover here, you might want to check out
http://stackoverflow.com/tags/spring-cloud-dataflow[stackoverflow.com] to see if someone has
already provided an answer; this is also a great place to ask new questions (please use
the `spring-cloud-dataflow` tag).

We're also more than happy to extend this section; If you want to add a '`how-to`' you
can send us a {github-code}[pull request].
--

== Configure Remote Maven Repository

If you'd like to connect to your organization's internal maven repository, you can override the default
repository location by passing the credentials via the following environment properties:

[source,bash]
----
export MAVEN_LOCAL_REPOSITORY=mylocalMavenRepo
export MAVEN_REMOTE_REPOSITORIES_REPO1_URL=https://repo1
export MAVEN_REMOTE_REPOSITORIES_REPO1_AUTH_USERNAME=user1
export MAVEN_REMOTE_REPOSITORIES_REPO1_AUTH_PASSWORD=<PASSWORD>
export MAVEN_REMOTE_REPOSITORIES_REPO2_URL=https://repo2
----

If you are running behind a proxy, then you need to specify the proxy settings via environment properties
like this:

[source,bash]
----
export MAVEN_PROXY_PROTOCOL=https
export MAVEN_PROXY_HOST=host1
export MAVEN_PROXY_PORT=8090
export MAVEN_PROXY_NON_PROXY_HOSTS='host2|host3'
export MAVEN_PROXY_AUTH_USERNAME=user1
export MAVEN_PROXY_AUTH_PASSWORD=<PASSWORD>
----

Alternatively, you can pass them wrapped inside `SPRING_APPLICATION_JSON` environment property like
the following:

[source,json]
----
export SPRING_APPLICATION_JSON='{ "maven": { "local-repository": null,"remote-repositories": { "repo1": { "url": "https://repo1", "auth": { "username": "repo1user", "password": "<PASSWORD>" } }, "repo2": { "url": "https://repo2" } }, "proxy": { "host": "proxyhost", "port": 9018, "auth": { "username": "proxyuser", "password": "<PASSWORD>" } } } }'
----

Formatted JSON:

[source,json]
----
SPRING_APPLICATION_JSON='{
  "maven": {
    "local-repository": null,
    "remote-repositories": {
      "repo1": {
        "url": "https://repo1",
        "auth": {
          "username": "repo1user",
          "password": "<PASSWORD>"
        }
      },
      "repo2": {
        "url": "https://repo2"
      }
    },
    "proxy": {
      "host": "proxyhost",
      "port": 9018,
      "auth": {
        "username": "proxyuser",
        "password": "<PASSWORD>"
      }
    }
  }
}'
----

NOTE: Depending on Spring Cloud Data Flow's server implementation, you may have to pass the
environment properties using the platform specific environment-setting capabilities. For instance,
in Cloud Foundry, you'd be passing them as `cf set-env SPRING_APPLICATION_JSON`,
`cf set-env MAVEN_REMOTE_REPOSITORIES_REPO1_URL` etc.

<commit_msg>Remove incorrect env-var config from docs<commit_after>[[howto]]
= '`How-to`' guides

[partintro]
--
This section provides answers to some common '`how do I do that...`' type of questions
that often arise when using Spring Cloud Data Flow. 

If you are having a specific problem that we don't cover here, you might want to check out
http://stackoverflow.com/tags/spring-cloud-dataflow[stackoverflow.com] to see if someone has
already provided an answer; this is also a great place to ask new questions (please use
the `spring-cloud-dataflow` tag).

We're also more than happy to extend this section; If you want to add a '`how-to`' you
can send us a {github-code}[pull request].
--

== Configure Remote Maven Repository

If you'd like to connect to a "custom" remote maven repository, you can override the default
repository location by passing the credentials via the following environment property:

[source,json]
----
export SPRING_APPLICATION_JSON='{ "maven": { "local-repository": null,"remote-repositories": { "repo1": { "url": "https://repo1", "auth": { "username": "repo1user", "password": "<PASSWORD>" } }, "repo2": { "url": "https://repo2" } }, "proxy": { "host": "proxyhost", "port": 9018, "auth": { "username": "proxyuser", "password": "<PASSWORD>" } } } }'
----

Formatted JSON:

[source,json]
----
SPRING_APPLICATION_JSON='{
  "maven": {
    "local-repository": null,
    "remote-repositories": {
      "repo1": {
        "url": "https://repo1",
        "auth": {
          "username": "repo1user",
          "password": "<PASSWORD>"
        }
      },
      "repo2": {
        "url": "https://repo2"
      }
    },
    "proxy": {
      "host": "proxyhost",
      "port": 9018,
      "auth": {
        "username": "proxyuser",
        "password": "<PASSWORD>"
      }
    }
  }
}'
----

NOTE: Depending on Spring Cloud Data Flow's server implementation, you may have to pass the
environment properties using the platform specific environment-setting capabilities. For instance,
in Cloud Foundry, you'd be passing them as `cf set-env SPRING_APPLICATION_JSON`.


{'fraction_non_alphanumeric': 0.13227722772277228, 'fraction_numerical': 0.010297029702970298, 'mean_word_length': 3.8849129593810443, 'pattern_counts': {'":': 64, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7055782', 'n_tokens_mistral': 1625, 'n_tokens_neox': 1562, 'n_words': 515}