Docs: Update minimum-should-match.asciidoc

Add %-sign to examle in the last section

Closes #8157

[[query-dsl-minimum-should-match]]
=== Minimum Should Match

The `minimum_should_match` parameter possible values:

[cols="<,<,<",options="header",]
|=======================================================================
|Type |Example |Description
|Integer |`3` |Indicates a fixed value regardless of the number of
optional clauses.

|Negative integer |`-2` |Indicates that the total number of optional
clauses, minus this number should be mandatory.

|Percentage |`75%` |Indicates that this percent of the total number of
optional clauses are necessary. The number computed from the percentage
is rounded down and used as the minimum.

|Negative percentage |`-25%` |Indicates that this percent of the total
number of optional clauses can be missing. The number computed from the
percentage is rounded down, before being subtracted from the total to
determine the minimum.

|Combination |`3<90%` |A positive integer, followed by the less-than
symbol, followed by any of the previously mentioned specifiers is a
conditional specification. It indicates that if the number of optional
clauses is equal to (or less than) the integer, they are all required,
but if it's greater than the integer, the specification applies. In this
example: if there are 1 to 3 clauses they are all required, but for 4 or
more clauses only 90% are required.

|Multiple combinations |`2<-25% 9<-3` |Multiple conditional
specifications can be separated by spaces, each one only being valid for
numbers greater than the one before it. In this example: if there are 1
or 2 clauses both are required, if there are 3-9 clauses all but 25% are
required, and if there are more than 9 clauses, all but three are
required.
|=======================================================================

*NOTE:*

When dealing with percentages, negative values can be used to get
different behavior in edge cases. 75% and -25% mean the same thing when
dealing with 4 clauses, but when dealing with 5 clauses 75% means 3 are
required, but -25% means 4 are required.

If the calculations based on the specification determine that no
optional clauses are needed, the usual rules about BooleanQueries still
apply at search time (a BooleanQuery containing no required clauses must
still match at least one optional clause)

No matter what number the calculation arrives at, a value greater than
the number of optional clauses, or a value less than 1 will never be
used. (ie: no matter how low or how high the result of the calculation
result is, the minimum number of required matches will never be lower
than 1 or greater than the number of clauses.

[[query-dsl-minimum-should-match]]
=== Minimum Should Match

The `minimum_should_match` parameter possible values:

[cols="<,<,<",options="header",]
|=======================================================================
|Type |Example |Description
|Integer |`3` |Indicates a fixed value regardless of the number of
optional clauses.

|Negative integer |`-2` |Indicates that the total number of optional
clauses, minus this number should be mandatory.

|Percentage |`75%` |Indicates that this percent of the total number of
optional clauses are necessary. The number computed from the percentage
is rounded down and used as the minimum.

|Negative percentage |`-25%` |Indicates that this percent of the total
number of optional clauses can be missing. The number computed from the
percentage is rounded down, before being subtracted from the total to
determine the minimum.

|Combination |`3<90%` |A positive integer, followed by the less-than
symbol, followed by any of the previously mentioned specifiers is a
conditional specification. It indicates that if the number of optional
clauses is equal to (or less than) the integer, they are all required,
but if it's greater than the integer, the specification applies. In this
example: if there are 1 to 3 clauses they are all required, but for 4 or
more clauses only 90% are required.

|Multiple combinations |`2<-25 9<-3` |Multiple conditional
specifications can be separated by spaces, each one only being valid for
numbers greater than the one before it. In this example: if there are 1
or 2 clauses both are required, if there are 3-9 clauses all but 25% are
required, and if there are more than 9 clauses, all but three are
required.
|=======================================================================

*NOTE:*

When dealing with percentages, negative values can be used to get
different behavior in edge cases. 75% and -25% mean the same thing when
dealing with 4 clauses, but when dealing with 5 clauses 75% means 3 are
required, but -25% means 4 are required.

If the calculations based on the specification determine that no
optional clauses are needed, the usual rules about BooleanQueries still
apply at search time (a BooleanQuery containing no required clauses must
still match at least one optional clause)

No matter what number the calculation arrives at, a value greater than
the number of optional clauses, or a value less than 1 will never be
used. (ie: no matter how low or how high the result of the calculation
result is, the minimum number of required matches will never be lower
than 1 or greater than the number of clauses.


Documentation rewording

Documentation rewording

Co-authored-by: Octavia Togami <19e24b89572cf32e772a4df489d8679fbb904d05@gmail.com>
Signed-off-by: Marcin Mielnicki <df0fc51f55bb3fb4ccd695f6dbaea2fe3e086b4f@gmail.com>

// Copyright 2017 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

[[command_line_interface]]
= Command-Line Interface

[.lead]
The command-line interface is one of the primary methods of interacting with Gradle. The following serves as a reference of executing and customizing Gradle use of a command-line or when writing scripts or configuring continuous integration.

Use of the <<gradle_wrapper.adoc#gradle_wrapper, Gradle Wrapper>> is highly encouraged. You should substitute `./gradlew` or `gradlew.bat` for `gradle` in all following examples when using the Wrapper.

Executing Gradle on the command-line conforms to the following structure. Options are allowed before and after task names.
----
gradle [taskName...] [--option-name...]
----

If multiple tasks are specified, they should be separated with a space.

Options that accept values can be specified with or without `=` between the option and argument; however, use of `=` is recommended.
----
--console=plain
----

Options that enable behavior have long-form options with inverses specified with `--no-`. The following are opposites.
----
--build-cache
--no-build-cache
----

Many long-form options, have short option equivalents. The following are equivalent:
----
--help
-h
----

[NOTE]
====
Many command-line flags can be specified in `gradle.properties` to avoid needing to be typed. See the <<build_environment.adoc#sec:gradle_configuration_properties, configuring build environment guide>> for details.
====

The following sections describe use of the Gradle command-line interface, grouped roughly by user goal. Some plugins also add their own command line options, for example <<java_testing.adoc#test_filtering,`--tests` for Java test filtering>>. For more information on exposing command line options for your own tasks, see <<custom_tasks.adoc#sec:declaring_and_using_command_line_options,Declaring and using command-line options>>.

[[sec:command_line_executing_tasks]]
== Executing tasks

You can learn about what projects and tasks are available in the <<#sec:command_line_project_reporting, project reporting section>>.
Most builds support a common set of tasks known as <<more_about_tasks#sec:lifecycle_tasks,_lifecycle tasks_>>. These include the `build`, `assemble`, and `check` tasks.

In order to execute a task called "myTask" on the root project, type:
----
$ gradle :myTask
----

This will run the single "myTask" and also all of its <<tutorial_using_tasks.adoc#sec:task_dependencies,task dependencies>>.

[[executing_tasks_in_multi_project_builds]]
=== Executing tasks in multi-project builds

In a <<intro_multi_project_builds.adoc#intro_multi_project_builds, multi-project build>>, subproject tasks can be executed with ":" separating subproject name and task name.
The following are equivalent _when run from the root project_:
----
$ gradle :my-subproject:taskName
$ gradle my-subproject:taskName
----

You can also run a task for _all_ subprojects by using a task _selector_ that consists of the task name only.
For example, this will run the "test" task for all subprojects when invoked from the root project directory:
----
$ gradle test
----

[NOTE]
====
Some tasks selectors, like `help` or `dependencies`, will only run the task on the project they are invoked on and not on all the subprojects.
The main motivation for this is that these tasks print out information that would be hard to process if it combined the information from all projects.
====

When invoking Gradle from within a subproject, the project name should be omitted:
----
$ cd my-subproject
$ gradle taskName
----

[NOTE]
====
When executing the Gradle Wrapper from subprojects, one must reference `gradlew` relatively. For example: `../gradlew taskName`. The community http://www.gdub.rocks/[gdub project] aims to make this more convenient.
====

=== Executing multiple tasks
You can also specify multiple tasks. For example, the following will execute the `test` and `deploy` tasks in the order that they are listed on the command-line and will also execute the dependencies for each task.

----
$ gradle test deploy
----

[[sec:excluding_tasks_from_the_command_line]]
=== Excluding tasks from execution
You can exclude a task from being executed using the `-x` or `--exclude-task` command-line option and providing the name of the task to exclude.

.Simple Task Graph
image::commandLineTutorialTasks.png[]

.Excluding tasks
----
$ gradle dist --exclude-task test
include::{snippetsPath}/tutorial/excludeTasks/tests/excludeTask.out[]
----

You can see that the `test` task is not executed, even though it is a dependency of the `dist` task. The `test` task's dependencies such as `compileTest` are not executed either. Those dependencies of `test` that are required by another task, such as `compile`, are still executed.

[[sec:rerun_tasks]]
=== Forcing tasks to execute

You can force Gradle to execute all tasks ignoring <<more_about_tasks.adoc#sec:up_to_date_checks,up-to-date checks>> using the `--rerun-tasks` option:

----
$ gradle test --rerun-tasks
----

This will force `test` and _all_ task dependencies of `test` to execute. It's a little like running `gradle clean test`, but without the build's generated output being deleted.

[[sec:continue_build_on_failure]]
=== Continuing the build when a failure occurs

By default, Gradle will abort execution and fail the build as soon as any task fails. This allows the build to complete sooner, but hides other failures that would have occurred. In order to discover as many failures as possible in a single build execution, you can use the `--continue` option.

----
$ gradle test --continue
----

When executed with `--continue`, Gradle will execute _every_ task to be executed where all of the dependencies for that task completed without failure, instead of stopping as soon as the first failure is encountered. Each of the encountered failures will be reported at the end of the build.

If a task fails, any subsequent tasks that were depending on it will not be executed. For example, tests will not run if there is a compilation failure in the code under test; because the test task will depend on the compilation task (either directly or indirectly).

[[sec:name_abbreviation]]
=== Name abbreviation

When you specify tasks on the command-line, you don’t have to provide the full name of the task. You only need to provide enough of the task name to uniquely identify the task. For example, it's likely `gradle che` is enough for Gradle to identify the `check` task.

The same applies for project names. You can execute the `check` task in the `library` subproject with the `gradle lib:che` command.

You can use https://en.wikipedia.org/wiki/Camel_case[camel case] patterns for more complex abbreviations. These patterns are expanded to match camel case and https://en.wikipedia.org/wiki/Kebab_case[kebab case] names. For example the pattern `foBa` (or even `fB`) matches `fooBar` and `foo-bar`.

More concretely, you can run the `compileTest` task in the `my-awesome-library` subproject with the `gradle  mAL:cT` command.

.Abbreviated project and task names
----
$ gradle  mAL:cT
include::{snippetsPath}/tutorial/nameMatching/tests/nameMatching.out[]
----

You can also use these abbreviations with the -x command-line option.

== Common tasks

The following are task conventions applied by built-in and most major Gradle plugins.

=== Computing all outputs

It is common in Gradle builds for the `build` task to designate assembling all outputs and running all checks.

----
$ gradle build
----

=== Running applications

It is common for applications to be run with the `run` task, which assembles the application and executes some script or binary.

----
$ gradle run
----

=== Running all checks

It is common for _all_ verification tasks, including tests and linting, to be executed using the `check` task.

----
$ gradle check
----

=== Cleaning outputs

You can delete the contents of the build directory using the `clean` task, though doing so will cause pre-computed outputs to be lost, causing significant additional build time for the subsequent task execution.

----
$ gradle clean
----

[[sec:command_line_project_reporting]]
== Project reporting

Gradle provides several built-in tasks which show particular details of your build. This can be useful for understanding the structure and dependencies of your build, and for debugging problems.

You can get basic help about available reporting options using `gradle help`.

=== Listing projects

Running `gradle projects` gives you a list of the sub-projects of the selected project, displayed in a hierarchy.

----
$ gradle projects
----

You also get a project report within build scans. Learn more about https://scans.gradle.com/[creating build scans].

[[sec:listing_tasks]]
=== Listing tasks

Running `gradle tasks` gives you a list of the main tasks of the selected project. This report shows the default tasks for the project, if any, and a description for each task.

----
$ gradle tasks
----

By default, this report shows only those tasks which have been assigned to a task group. You can obtain more information in the task listing using the `--all` option.

----
$ gradle tasks --all
----

If you need to be more precise, you can display only the tasks from a specific group using the `--group` option.

----
$ gradle tasks --group="build setup"
----

[[sec:show_task_details]]
=== Show task usage details

Running `gradle help --task someTask` gives you detailed information about a specific task.

.Obtaining detailed help for tasks
----
$ gradle -q help --task libs
include::{snippetsPath}/tutorial/projectReports/tests/taskHelp.out[]
----

This information includes the full task path, the task type, possible command line options and the description of the given task.

=== Reporting dependencies

Build scans give a full, visual report of what dependencies exist on which configurations, transitive dependencies, and dependency version selection.

----
$ gradle myTask --scan
----

This will give you a link to a web-based report, where you can find dependency information like this.

image::gradle-core-test-build-scan-dependencies.png[Build Scan dependencies report]

Learn more in <<viewing_debugging_dependencies.adoc#viewing-debugging-dependencies,Viewing and debugging dependencies>>.

=== Listing project dependencies

Running `gradle dependencies` gives you a list of the dependencies of the selected project, broken down by configuration. For each configuration, the direct and transitive dependencies of that configuration are shown in a tree. Below is an example of this report:

----
$ gradle dependencies
----

Concrete examples of build scripts and output available in the <<viewing_debugging_dependencies.adoc#viewing-debugging-dependencies,Viewing and debugging dependencies>>.

Running `gradle buildEnvironment` visualises the buildscript dependencies of the selected project, similarly to how `gradle dependencies` visualizes the dependencies of the software being built.

----
$ gradle buildEnvironment
----

Running `gradle dependencyInsight` gives you an insight into a particular dependency (or dependencies) that match specified input.

----
$ gradle dependencyInsight
----

Since a dependency report can get large, it can be useful to restrict the report to a particular configuration. This is achieved with the optional `--configuration` parameter:

[[sec:listing_properties]]
=== Listing project properties

Running `gradle properties` gives you a list of the properties of the selected project.

.Information about properties
----
$ gradle -q api:properties
include::{snippetsPath}/tutorial/projectReports/tests/propertyListReport.out[]
----

[[sec:command_line_completion]]
== Command-line completion

Gradle provides bash and zsh tab completion support for tasks, options, and Gradle properties through https://github.com/gradle/gradle-completion[gradle-completion], installed separately.

.Gradle Completion
image::gradle-completion-4.0.gif[]

[[sec:command_line_debugging]]
== Debugging options

`-?`, `-h`, `--help`::
Shows a help message with all available CLI options.

`-v`, `--version`::
Prints Gradle, Groovy, Ant, JVM, and operating system version information.

`-S`, `--full-stacktrace`::
Print out the full (very verbose) stacktrace for any exceptions. See also <<#sec:command_line_logging, logging options>>.

`-s`, `--stacktrace`::
Print out the stacktrace also for user exceptions (e.g. compile error).  See also <<#sec:command_line_logging, logging options>>.

`--scan`::
Create a https://gradle.com/build-scans[build scan] with fine-grained information about all aspects of your Gradle build.

`-Dorg.gradle.debug=true`::
Debug Gradle client (non-Daemon) process. Gradle will wait for you to attach a debugger at `localhost:5005` by default.

`-Dorg.gradle.debug.port=(port number)`::
Specifies the port number to listen on when debug is enabled. _Default is `5005`._

`-Dorg.gradle.debug.server=true`::
If set to `true` and debugging is enabled, Gradle will run the build with the socket-attach mode of the debugger. Otherwise, the socket-listen mode is used.

`-Dorg.gradle.debug.suspend=true`::
When set to `true` and debugging is enabled, the JVM running Gradle will suspend until a debugger is attached.

`-Dorg.gradle.daemon.debug=true`::
Debug <<gradle_daemon.adoc#gradle_daemon, Gradle Daemon>> process.

[[sec:command_line_performance]]
== Performance options
Try these options when optimizing build performance. Learn more about <<performance.adoc#performance_gradle,improving performance of Gradle builds here>>.

Many of these options can be specified in `gradle.properties` so command-line flags are not necessary. See the <<build_environment.adoc#sec:gradle_configuration_properties, configuring build environment guide>>.

`--build-cache`, `--no-build-cache`::
Toggles the <<build_cache.adoc#build_cache, Gradle build cache>>. Gradle will try to reuse outputs from previous builds. _Default is off_.

`--configure-on-demand`, `--no-configure-on-demand`::
Toggles <<multi_project_configuration_and_execution.adoc#sec:configuration_on_demand, Configure-on-demand>>. Only relevant projects are configured in this build run. _Default is off_.

`--max-workers`::
Sets maximum number of workers that Gradle may use. _Default is number of processors_.

`--parallel`, `--no-parallel`::
Build projects in parallel. For limitations of this option, see <<multi_project_configuration_and_execution.adoc#sec:parallel_execution, Parallel Project Execution>>. _Default is off_.

`--priority`::
Specifies the scheduling priority for the Gradle daemon and all processes launched by it. Values are `normal` or `low`. _Default is normal_.

`--profile`::
Generates a high-level performance report in the `$buildDir/reports/profile` directory. `--scan` is preferred.

`--scan`::
Generate a build scan with detailed performance diagnostics.

image::gradle-core-test-build-scan-performance.png[Build Scan performance report]

`--watch-fs`, `--no-watch-fs`::
Toggles <<gradle_daemon.adoc#sec:daemon_watch_fs,watching the file system>>.
When enabled Gradle re-uses information it collects about the file system between builds.
_Enabled by default on operating systems where Gradle supports this feature._

=== Gradle daemon options
You can manage the <<gradle_daemon.adoc#gradle_daemon,Gradle Daemon>> through the following command line options.

`--daemon`, `--no-daemon`::
Use the <<gradle_daemon.adoc#gradle_daemon, Gradle Daemon>> to run the build. Starts the daemon if not running or existing daemon busy. _Default is on_.

`--foreground`::
Starts the Gradle Daemon in a foreground process.

`--status` (Standalone command)::
Run `gradle --status` to list running and recently stopped Gradle daemons. Only displays daemons of the same Gradle version.

`--stop` (Standalone command)::
Run `gradle --stop` to stop all Gradle Daemons of the same version.

`-Dorg.gradle.daemon.idletimeout=(number of milliseconds)`::
Gradle Daemon will stop itself after this number of milliseconds of idle time. _Default is 10800000_ (3 hours).

[[sec:command_line_logging]]
== Logging options

=== Setting log level
You can customize the verbosity of Gradle logging with the following options, ordered from least verbose to most verbose. Learn more in the <<logging.adoc#logging, logging documentation>>.

`-Dorg.gradle.logging.level=(quiet,warn,lifecycle,info,debug)`::
Set logging level via Gradle properties.

`-q`, `--quiet`::
Log errors only.

`-w`, `--warn`::
Set log level to warn.

`-i`, `--info`::
Set log level to info.

`-d`, `--debug`::
Log in debug mode (includes normal stacktrace).

Lifecycle is the default log level.

[[sec:command_line_customizing_log_format]]
=== Customizing log format
You can control the use of rich output (colors and font variants) by specifying the "console" mode in the following ways:

`-Dorg.gradle.console=(auto,plain,rich,verbose)`::
Specify console mode via Gradle properties. Different modes described immediately below.

`--console=(auto,plain,rich,verbose)`::
Specifies which type of console output to generate.
+
Set to `plain` to generate plain text only. This option disables all color and other rich output in the console output. This is the default when Gradle is _not_ attached to a terminal.
+
Set to `auto` (the default) to enable color and other rich output in the console output when the build process is attached to a console, or to generate plain text only when not attached to a console. _This is the default when Gradle is attached to a terminal._
+
Set to `rich` to enable color and other rich output in the console output, regardless of whether the build process is not attached to a console. When not attached to a console, the build output will use ANSI control characters to generate the rich output.
+
Set to `verbose` to enable color and other rich output like the `rich`, but output task names and outcomes at the lifecycle log level, as is done by default in Gradle 3.5 and earlier.

[[sec:command_line_warnings]]
=== Showing or hiding warnings
By default, Gradle won't display all warnings (e.g. deprecation warnings). Instead, Gradle will collect them and render a summary at the end of the build like:

----
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
----

You can control the verbosity of warnings on the console with the following options:

`-Dorg.gradle.warning.mode=(all,fail,none,summary)`::
Specify warning mode via <<build_environment.adoc#sec:gradle_configuration_properties, Gradle properties>>. Different modes described immediately below.

`--warning-mode=(all,fail,none,summary)`::
Specifies how to log warnings. Default is `summary`.
+
Set to `all` to log all warnings.
+
Set to `fail` to log all warnings and fail the build if there are any warnings.
+
Set to `summary` to suppress all warnings and log a summary at the end of the build.
+
Set to `none` to suppress all warnings, including the summary at the end of the build.

[[sec:rich_console]]
=== Rich Console
Gradle's rich console displays extra information while builds are running.

image::rich-cli.png[alt="Gradle Rich Console"]

Features:

 * Progress bar and timer visually describe overall status
 * Parallel work-in-progress lines below describe what is happening now
 * Colors and fonts are used to highlight important output and errors

[[sec:command_line_execution_options]]
== Execution options
The following options affect how builds are executed, by changing what is built or how dependencies are resolved.

`--include-build`::
Run the build as a composite, including the specified build. See <<composite_builds.adoc#composite_builds, Composite Builds>>.

`--offline`::
Specifies that the build should operate without accessing network resources. Learn more about <<dynamic_versions.adoc#sec:controlling_dependency_caching_command_line,options to override dependency caching>>.

`--refresh-dependencies`::
Refresh the state of dependencies. Learn more about how to use this in the <<dynamic_versions.adoc#sec:controlling_dependency_caching_command_line,dependency management docs>>.

`--dry-run`::
Run Gradle with all task actions disabled. Use this to show which task would have executed.

`--write-locks`::
Indicates that all resolved configurations that are _lockable_ should have their lock state persisted.
Learn more about this in <<dependency_locking.adoc#dependency-locking,dependency locking>>.

`--update-locks <group:name>[,<group:name>]*`::
Indicates that versions for the specified modules have to be updated in the lock file.
This flag also implies `--write-locks`.
Learn more about this in <<dependency_locking.adoc#dependency-locking,dependency locking>>.

`--no-rebuild`::
Do not rebuild project dependencies.
Useful for <<organizing_gradle_projects.adoc#sec:build_sources, debugging and fine-tuning `buildSrc`>>, but can lead to wrong results. Use with caution!

[[sec:environment_options]]
== Environment options
You can customize many aspects about where build scripts, settings, caches, and so on through the options below. Learn more about customizing your <<build_environment.adoc#build_environment, build environment>>.

`-b`, `--build-file` (deprecated)::
Specifies the build file. For example: `gradle --build-file=foo.gradle`. The default is `build.gradle`, then `build.gradle.kts`.

`-c`, `--settings-file` (deprecated)::
Specifies the settings file. For example: `gradle --settings-file=somewhere/else/settings.gradle`

`-g`, `--gradle-user-home`::
Specifies the Gradle user home directory. The default is the `.gradle` directory in the user's home directory.

`-p`, `--project-dir`::
Specifies the start directory for Gradle. Defaults to current directory.

`--project-cache-dir`::
Specifies the project-specific cache directory. Default value is `.gradle` in the root project directory.

`-D`, `--system-prop`::
Sets a system property of the JVM, for example `-Dmyprop=myvalue`. See <<build_environment.adoc#sec:gradle_system_properties,System Properties>>.

`-I`, `--init-script`::
Specifies an initialization script. See <<init_scripts.adoc#init_scripts,Init Scripts>>.

`-P`, `--project-prop`::
Sets a project property of the root project, for example `-Pmyprop=myvalue`. See <<build_environment.adoc#sec:project_properties,Project Properties>>.

`-Dorg.gradle.jvmargs`::
Set JVM arguments.

`-Dorg.gradle.java.home`::
Set JDK home dir.

[[sec:command_line_bootstrapping_projects]]
== Bootstrapping new projects

=== Creating new Gradle builds
Use the built-in `gradle init` task to create a new Gradle builds, with new or existing projects.

----
$ gradle init
----

Most of the time you'll want to specify a project type. Available types include `basic` (default), `java-library`, `java-application`, and more. See <<build_init_plugin.adoc#build_init_plugin, init plugin documentation>> for details.

----
$ gradle init --type java-library
----

=== Standardize and provision Gradle
The built-in `gradle wrapper` task generates a script, `gradlew`, that invokes a declared version of Gradle, downloading it beforehand if necessary.

----
$ gradle wrapper --gradle-version=4.4
----

You can also specify `--distribution-type=(bin|all)`, `--gradle-distribution-url`, `--gradle-distribution-sha256-sum` in addition to `--gradle-version`. Full details on how to use these options are documented in the <<gradle_wrapper.adoc#gradle_wrapper,Gradle wrapper section>>.

[[sec:continuous_build]]
== Continuous Build

Continuous Build allows you to automatically re-execute the requested tasks when task inputs change.

For example, you can continuously run the `test` task and all dependent tasks by running:

----
$ gradle test --continuous
----

Gradle will behave as if you ran `gradle test` after a change to sources or tests that contribute to the requested tasks. This means that unrelated changes (such as changes to build scripts) will not trigger a rebuild. In order to incorporate build logic changes, the continuous build must be restarted manually.

=== Terminating Continuous Build

If Gradle is attached to an interactive input source, such as a terminal, the continuous build can be exited by pressing `CTRL-D` (On Microsoft Windows, it is required to also press `ENTER` or `RETURN` after `CTRL-D`). If Gradle is not attached to an interactive input source (e.g. is running as part of a script), the build process must be terminated (e.g. using the `kill` command or similar). If the build is being executed via the Tooling API, the build can be cancelled using the Tooling API's cancellation mechanism.

[[continuous_build_limitations]]
=== Limitations and quirks

There are several issues to be aware with the current implementation of continuous build. These are likely to be addressed in future Gradle releases.

[[sec:build_cycles]]
==== Build cycles

Gradle starts watching for changes just before a task executes. If a task modifies its own inputs while executing, Gradle will detect the change and trigger a new build. If every time the task executes, the inputs are modified again, the build will be triggered again. This isn't unique to continuous build. A task that modifies its own inputs will never be considered up-to-date when run "normally" without continuous build.

If your build enters a build cycle like this, you can track down the task by looking at the list of files reported changed by Gradle. After identifying the file(s) that are changed during each build, you should look for a task that has that file as an input. In some cases, it may be obvious (e.g., a Java file is compiled with `compileJava`). In other cases, you can use `--info` logging to find the task that is out-of-date due to the identified files.

[[sec:continuous_build_limitations_jdk9]]
==== Restrictions with Java 9

Due to class access restrictions related to Java 9, Gradle cannot set some operating system specific options, which means that:

* On macOS, Gradle will poll for file changes every 10 seconds instead of every 2 seconds.
* On Windows, Gradle must use individual file watches (like on Linux/Mac OS), which may cause continuous build to no longer work on very large projects.

[[sec:performance_and_stability]]
==== Performance and stability

The JDK file watching facility relies on inefficient file system polling on macOS (see: https://bugs.openjdk.java.net/browse/JDK-7133447[JDK-7133447]). This can significantly delay notification of changes on large projects with many source files.

Additionally, the watching mechanism may deadlock under _heavy_ load on macOS (see: https://bugs.openjdk.java.net/browse/JDK-8079620[JDK-8079620]). This will manifest as Gradle appearing not to notice file changes. If you suspect this is occurring, exit continuous build and start again.

On Linux, OpenJDK's implementation of the file watch service can sometimes miss file system events (see: https://bugs.openjdk.java.net/browse/JDK-8145981[JDK-8145981]).

[[sec:changes_to_symbolic_links]]
==== Changes to symbolic links

 * Creating or removing symbolic link to files will initiate a build.
 * Modifying the target of a symbolic link will not cause a rebuild.
 * Creating or removing symbolic links to directories will not cause rebuilds.
 * Creating new files in the target directory of a symbolic link will not cause a rebuild.
 * Deleting the target directory will not cause a rebuild.

[[sec:changes_to_build_logic_are_not_considered]]
==== Changes to build logic are not considered

The current implementation does not recalculate the build model on subsequent builds. This means that changes to task configuration, or any other change to the build model, are effectively ignored.

// Copyright 2017 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

[[command_line_interface]]
= Command-Line Interface

[.lead]
The command-line interface is one of the primary methods of interacting with Gradle. The following serves as a reference of executing and customizing Gradle use of a command-line or when writing scripts or configuring continuous integration.

Use of the <<gradle_wrapper.adoc#gradle_wrapper, Gradle Wrapper>> is highly encouraged. You should substitute `./gradlew` or `gradlew.bat` for `gradle` in all following examples when using the Wrapper.

Executing Gradle on the command-line conforms to the following structure. Options are allowed before and after task names.
----
gradle [taskName...] [--option-name...]
----

If multiple tasks are specified, they should be separated with a space.

Options that accept values can be specified with or without `=` between the option and argument; however, use of `=` is recommended.
----
--console=plain
----

Options that enable behavior have long-form options with inverses specified with `--no-`. The following are opposites.
----
--build-cache
--no-build-cache
----

Many long-form options, have short option equivalents. The following are equivalent:
----
--help
-h
----

[NOTE]
====
Many command-line flags can be specified in `gradle.properties` to avoid needing to be typed. See the <<build_environment.adoc#sec:gradle_configuration_properties, configuring build environment guide>> for details.
====

The following sections describe use of the Gradle command-line interface, grouped roughly by user goal. Some plugins also add their own command line options, for example <<java_testing.adoc#test_filtering,`--tests` for Java test filtering>>. For more information on exposing command line options for your own tasks, see <<custom_tasks.adoc#sec:declaring_and_using_command_line_options,Declaring and using command-line options>>.

[[sec:command_line_executing_tasks]]
== Executing tasks

You can learn about what projects and tasks are available in the <<#sec:command_line_project_reporting, project reporting section>>.
Most builds support a common set of tasks known as <<more_about_tasks#sec:lifecycle_tasks,_lifecycle tasks_>>. These include the `build`, `assemble`, and `check` tasks.

In order to execute a task called "myTask" on the root project, type:
----
$ gradle :myTask
----

This will run the single "myTask" and also all of its <<tutorial_using_tasks.adoc#sec:task_dependencies,task dependencies>>.

[[executing_tasks_in_multi_project_builds]]
=== Executing tasks in multi-project builds

In a <<intro_multi_project_builds.adoc#intro_multi_project_builds, multi-project build>>, subproject tasks can be executed with ":" separating subproject name and task name.
The following are equivalent _when run from the root project_:
----
$ gradle :my-subproject:taskName
$ gradle my-subproject:taskName
----

You can also run a task for _all_ subprojects by using a task _selector_ that consists of the task name only.
For example, this will run the "test" task for all subprojects when invoked from the root project directory:
----
$ gradle test
----

[NOTE]
====
Some tasks selectors, like `help` or `dependencies`, will only run the task on the project they are invoked on and not on all the subprojects.
The main motivation for this is that these tasks print out information that would be hard to process if it combined the information from all projects.
====

When invoking Gradle from within a subproject, the project name should be omitted:
----
$ cd my-subproject
$ gradle taskName
----

[NOTE]
====
When executing the Gradle Wrapper from subprojects, one must reference `gradlew` relatively. For example: `../gradlew taskName`. The community http://www.gdub.rocks/[gdub project] aims to make this more convenient.
====

=== Executing multiple tasks
You can also specify multiple tasks. For example, the following will execute the `test` and `deploy` tasks in the order that they are listed on the command-line and will also execute the dependencies for each task.

----
$ gradle test deploy
----

[[sec:excluding_tasks_from_the_command_line]]
=== Excluding tasks from execution
You can exclude a task from being executed using the `-x` or `--exclude-task` command-line option and providing the name of the task to exclude.

.Simple Task Graph
image::commandLineTutorialTasks.png[]

.Excluding tasks
----
$ gradle dist --exclude-task test
include::{snippetsPath}/tutorial/excludeTasks/tests/excludeTask.out[]
----

You can see that the `test` task is not executed, even though it is a dependency of the `dist` task. The `test` task's dependencies such as `compileTest` are not executed either. Those dependencies of `test` that are required by another task, such as `compile`, are still executed.

[[sec:rerun_tasks]]
=== Forcing tasks to execute

You can force Gradle to execute all tasks ignoring <<more_about_tasks.adoc#sec:up_to_date_checks,up-to-date checks>> using the `--rerun-tasks` option:

----
$ gradle test --rerun-tasks
----

This will force `test` and _all_ task dependencies of `test` to execute. It's a little like running `gradle clean test`, but without the build's generated output being deleted.

[[sec:continue_build_on_failure]]
=== Continuing the build when a failure occurs

By default, Gradle will abort execution and fail the build as soon as any task fails. This allows the build to complete sooner, but hides other failures that would have occurred. In order to discover as many failures as possible in a single build execution, you can use the `--continue` option.

----
$ gradle test --continue
----

When executed with `--continue`, Gradle will execute _every_ task to be executed where all of the dependencies for that task completed without failure, instead of stopping as soon as the first failure is encountered. Each of the encountered failures will be reported at the end of the build.

If a task fails, any subsequent tasks that were depending on it will not be executed. For example, tests will not run if there is a compilation failure in the code under test; because the test task will depend on the compilation task (either directly or indirectly).

[[sec:name_abbreviation]]
=== Name abbreviation

When you specify tasks on the command-line, you don’t have to provide the full name of the task. You only need to provide enough of the task name to uniquely identify the task. For example, it's likely `gradle che` is enough for Gradle to identify the `check` task.

The same applies for project names. You can execute the `check` task in the `library` subproject with the `gradle lib:che` command.

You can use https://en.wikipedia.org/wiki/Camel_case[camel case] patterns for more complex abbreviations. These patterns are expanded to match camel case and https://en.wikipedia.org/wiki/Kebab_case[kebab case] names. For example the pattern `foBa` (or even `fB`) matches `fooBar` and `foo-bar`.

More concretely, you can run the `compileTest` task in the `my-awesome-library` subproject with the `gradle  mAL:cT` command.

.Abbreviated project and task names
----
$ gradle  mAL:cT
include::{snippetsPath}/tutorial/nameMatching/tests/nameMatching.out[]
----

You can also use these abbreviations with the -x command-line option.

== Common tasks

The following are task conventions applied by built-in and most major Gradle plugins.

=== Computing all outputs

It is common in Gradle builds for the `build` task to designate assembling all outputs and running all checks.

----
$ gradle build
----

=== Running applications

It is common for applications to be run with the `run` task, which assembles the application and executes some script or binary.

----
$ gradle run
----

=== Running all checks

It is common for _all_ verification tasks, including tests and linting, to be executed using the `check` task.

----
$ gradle check
----

=== Cleaning outputs

You can delete the contents of the build directory using the `clean` task, though doing so will cause pre-computed outputs to be lost, causing significant additional build time for the subsequent task execution.

----
$ gradle clean
----

[[sec:command_line_project_reporting]]
== Project reporting

Gradle provides several built-in tasks which show particular details of your build. This can be useful for understanding the structure and dependencies of your build, and for debugging problems.

You can get basic help about available reporting options using `gradle help`.

=== Listing projects

Running `gradle projects` gives you a list of the sub-projects of the selected project, displayed in a hierarchy.

----
$ gradle projects
----

You also get a project report within build scans. Learn more about https://scans.gradle.com/[creating build scans].

[[sec:listing_tasks]]
=== Listing tasks

Running `gradle tasks` gives you a list of the main tasks of the selected project. This report shows the default tasks for the project, if any, and a description for each task.

----
$ gradle tasks
----

By default, this report shows only those tasks which have been assigned to a task group. You can obtain more information in the task listing using the `--all` option.

----
$ gradle tasks --all
----

If you need to be more precise, you can display only the tasks from a specific group using the `--group` option.

----
$ gradle tasks --group="build setup"
----

[[sec:show_task_details]]
=== Show task usage details

Running `gradle help --task someTask` gives you detailed information about a specific task.

.Obtaining detailed help for tasks
----
$ gradle -q help --task libs
include::{snippetsPath}/tutorial/projectReports/tests/taskHelp.out[]
----

This information includes the full task path, the task type, possible command line options and the description of the given task.

=== Reporting dependencies

Build scans give a full, visual report of what dependencies exist on which configurations, transitive dependencies, and dependency version selection.

----
$ gradle myTask --scan
----

This will give you a link to a web-based report, where you can find dependency information like this.

image::gradle-core-test-build-scan-dependencies.png[Build Scan dependencies report]

Learn more in <<viewing_debugging_dependencies.adoc#viewing-debugging-dependencies,Viewing and debugging dependencies>>.

=== Listing project dependencies

Running `gradle dependencies` gives you a list of the dependencies of the selected project, broken down by configuration. For each configuration, the direct and transitive dependencies of that configuration are shown in a tree. Below is an example of this report:

----
$ gradle dependencies
----

Concrete examples of build scripts and output available in the <<viewing_debugging_dependencies.adoc#viewing-debugging-dependencies,Viewing and debugging dependencies>>.

Running `gradle buildEnvironment` visualises the buildscript dependencies of the selected project, similarly to how `gradle dependencies` visualizes the dependencies of the software being built.

----
$ gradle buildEnvironment
----

Running `gradle dependencyInsight` gives you an insight into a particular dependency (or dependencies) that match specified input.

----
$ gradle dependencyInsight
----

Since a dependency report can get large, it can be useful to restrict the report to a particular configuration. This is achieved with the optional `--configuration` parameter:

[[sec:listing_properties]]
=== Listing project properties

Running `gradle properties` gives you a list of the properties of the selected project.

.Information about properties
----
$ gradle -q api:properties
include::{snippetsPath}/tutorial/projectReports/tests/propertyListReport.out[]
----

[[sec:command_line_completion]]
== Command-line completion

Gradle provides bash and zsh tab completion support for tasks, options, and Gradle properties through https://github.com/gradle/gradle-completion[gradle-completion], installed separately.

.Gradle Completion
image::gradle-completion-4.0.gif[]

[[sec:command_line_debugging]]
== Debugging options

`-?`, `-h`, `--help`::
Shows a help message with all available CLI options.

`-v`, `--version`::
Prints Gradle, Groovy, Ant, JVM, and operating system version information.

`-S`, `--full-stacktrace`::
Print out the full (very verbose) stacktrace for any exceptions. See also <<#sec:command_line_logging, logging options>>.

`-s`, `--stacktrace`::
Print out the stacktrace also for user exceptions (e.g. compile error).  See also <<#sec:command_line_logging, logging options>>.

`--scan`::
Create a https://gradle.com/build-scans[build scan] with fine-grained information about all aspects of your Gradle build.

`-Dorg.gradle.debug=true`::
Debug Gradle client (non-Daemon) process. Gradle will wait for you to attach a debugger at `localhost:5005` by default.

`-Dorg.gradle.debug.port=(port number)`::
Specifies the port number on which process is listening when debug is enabled. _Default is `5005`._

`-Dorg.gradle.debug.server=true`::
If set to `true` and debugging is enabled, Gradle will run the build with the socket-attach mode of the debugger. Otherwise, the socket-listen mode is used.

`-Dorg.gradle.debug.suspend=true`::
When set to `true` and debugging is enabled, the JVM running Gradle will suspend until a debugger is attached.

`-Dorg.gradle.daemon.debug=true`::
Debug <<gradle_daemon.adoc#gradle_daemon, Gradle Daemon>> process.

[[sec:command_line_performance]]
== Performance options
Try these options when optimizing build performance. Learn more about <<performance.adoc#performance_gradle,improving performance of Gradle builds here>>.

Many of these options can be specified in `gradle.properties` so command-line flags are not necessary. See the <<build_environment.adoc#sec:gradle_configuration_properties, configuring build environment guide>>.

`--build-cache`, `--no-build-cache`::
Toggles the <<build_cache.adoc#build_cache, Gradle build cache>>. Gradle will try to reuse outputs from previous builds. _Default is off_.

`--configure-on-demand`, `--no-configure-on-demand`::
Toggles <<multi_project_configuration_and_execution.adoc#sec:configuration_on_demand, Configure-on-demand>>. Only relevant projects are configured in this build run. _Default is off_.

`--max-workers`::
Sets maximum number of workers that Gradle may use. _Default is number of processors_.

`--parallel`, `--no-parallel`::
Build projects in parallel. For limitations of this option, see <<multi_project_configuration_and_execution.adoc#sec:parallel_execution, Parallel Project Execution>>. _Default is off_.

`--priority`::
Specifies the scheduling priority for the Gradle daemon and all processes launched by it. Values are `normal` or `low`. _Default is normal_.

`--profile`::
Generates a high-level performance report in the `$buildDir/reports/profile` directory. `--scan` is preferred.

`--scan`::
Generate a build scan with detailed performance diagnostics.

image::gradle-core-test-build-scan-performance.png[Build Scan performance report]

`--watch-fs`, `--no-watch-fs`::
Toggles <<gradle_daemon.adoc#sec:daemon_watch_fs,watching the file system>>.
When enabled Gradle re-uses information it collects about the file system between builds.
_Enabled by default on operating systems where Gradle supports this feature._

=== Gradle daemon options
You can manage the <<gradle_daemon.adoc#gradle_daemon,Gradle Daemon>> through the following command line options.

`--daemon`, `--no-daemon`::
Use the <<gradle_daemon.adoc#gradle_daemon, Gradle Daemon>> to run the build. Starts the daemon if not running or existing daemon busy. _Default is on_.

`--foreground`::
Starts the Gradle Daemon in a foreground process.

`--status` (Standalone command)::
Run `gradle --status` to list running and recently stopped Gradle daemons. Only displays daemons of the same Gradle version.

`--stop` (Standalone command)::
Run `gradle --stop` to stop all Gradle Daemons of the same version.

`-Dorg.gradle.daemon.idletimeout=(number of milliseconds)`::
Gradle Daemon will stop itself after this number of milliseconds of idle time. _Default is 10800000_ (3 hours).

[[sec:command_line_logging]]
== Logging options

=== Setting log level
You can customize the verbosity of Gradle logging with the following options, ordered from least verbose to most verbose. Learn more in the <<logging.adoc#logging, logging documentation>>.

`-Dorg.gradle.logging.level=(quiet,warn,lifecycle,info,debug)`::
Set logging level via Gradle properties.

`-q`, `--quiet`::
Log errors only.

`-w`, `--warn`::
Set log level to warn.

`-i`, `--info`::
Set log level to info.

`-d`, `--debug`::
Log in debug mode (includes normal stacktrace).

Lifecycle is the default log level.

[[sec:command_line_customizing_log_format]]
=== Customizing log format
You can control the use of rich output (colors and font variants) by specifying the "console" mode in the following ways:

`-Dorg.gradle.console=(auto,plain,rich,verbose)`::
Specify console mode via Gradle properties. Different modes described immediately below.

`--console=(auto,plain,rich,verbose)`::
Specifies which type of console output to generate.
+
Set to `plain` to generate plain text only. This option disables all color and other rich output in the console output. This is the default when Gradle is _not_ attached to a terminal.
+
Set to `auto` (the default) to enable color and other rich output in the console output when the build process is attached to a console, or to generate plain text only when not attached to a console. _This is the default when Gradle is attached to a terminal._
+
Set to `rich` to enable color and other rich output in the console output, regardless of whether the build process is not attached to a console. When not attached to a console, the build output will use ANSI control characters to generate the rich output.
+
Set to `verbose` to enable color and other rich output like the `rich`, but output task names and outcomes at the lifecycle log level, as is done by default in Gradle 3.5 and earlier.

[[sec:command_line_warnings]]
=== Showing or hiding warnings
By default, Gradle won't display all warnings (e.g. deprecation warnings). Instead, Gradle will collect them and render a summary at the end of the build like:

----
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
----

You can control the verbosity of warnings on the console with the following options:

`-Dorg.gradle.warning.mode=(all,fail,none,summary)`::
Specify warning mode via <<build_environment.adoc#sec:gradle_configuration_properties, Gradle properties>>. Different modes described immediately below.

`--warning-mode=(all,fail,none,summary)`::
Specifies how to log warnings. Default is `summary`.
+
Set to `all` to log all warnings.
+
Set to `fail` to log all warnings and fail the build if there are any warnings.
+
Set to `summary` to suppress all warnings and log a summary at the end of the build.
+
Set to `none` to suppress all warnings, including the summary at the end of the build.

[[sec:rich_console]]
=== Rich Console
Gradle's rich console displays extra information while builds are running.

image::rich-cli.png[alt="Gradle Rich Console"]

Features:

 * Progress bar and timer visually describe overall status
 * Parallel work-in-progress lines below describe what is happening now
 * Colors and fonts are used to highlight important output and errors

[[sec:command_line_execution_options]]
== Execution options
The following options affect how builds are executed, by changing what is built or how dependencies are resolved.

`--include-build`::
Run the build as a composite, including the specified build. See <<composite_builds.adoc#composite_builds, Composite Builds>>.

`--offline`::
Specifies that the build should operate without accessing network resources. Learn more about <<dynamic_versions.adoc#sec:controlling_dependency_caching_command_line,options to override dependency caching>>.

`--refresh-dependencies`::
Refresh the state of dependencies. Learn more about how to use this in the <<dynamic_versions.adoc#sec:controlling_dependency_caching_command_line,dependency management docs>>.

`--dry-run`::
Run Gradle with all task actions disabled. Use this to show which task would have executed.

`--write-locks`::
Indicates that all resolved configurations that are _lockable_ should have their lock state persisted.
Learn more about this in <<dependency_locking.adoc#dependency-locking,dependency locking>>.

`--update-locks <group:name>[,<group:name>]*`::
Indicates that versions for the specified modules have to be updated in the lock file.
This flag also implies `--write-locks`.
Learn more about this in <<dependency_locking.adoc#dependency-locking,dependency locking>>.

`--no-rebuild`::
Do not rebuild project dependencies.
Useful for <<organizing_gradle_projects.adoc#sec:build_sources, debugging and fine-tuning `buildSrc`>>, but can lead to wrong results. Use with caution!

[[sec:environment_options]]
== Environment options
You can customize many aspects about where build scripts, settings, caches, and so on through the options below. Learn more about customizing your <<build_environment.adoc#build_environment, build environment>>.

`-b`, `--build-file` (deprecated)::
Specifies the build file. For example: `gradle --build-file=foo.gradle`. The default is `build.gradle`, then `build.gradle.kts`.

`-c`, `--settings-file` (deprecated)::
Specifies the settings file. For example: `gradle --settings-file=somewhere/else/settings.gradle`

`-g`, `--gradle-user-home`::
Specifies the Gradle user home directory. The default is the `.gradle` directory in the user's home directory.

`-p`, `--project-dir`::
Specifies the start directory for Gradle. Defaults to current directory.

`--project-cache-dir`::
Specifies the project-specific cache directory. Default value is `.gradle` in the root project directory.

`-D`, `--system-prop`::
Sets a system property of the JVM, for example `-Dmyprop=myvalue`. See <<build_environment.adoc#sec:gradle_system_properties,System Properties>>.

`-I`, `--init-script`::
Specifies an initialization script. See <<init_scripts.adoc#init_scripts,Init Scripts>>.

`-P`, `--project-prop`::
Sets a project property of the root project, for example `-Pmyprop=myvalue`. See <<build_environment.adoc#sec:project_properties,Project Properties>>.

`-Dorg.gradle.jvmargs`::
Set JVM arguments.

`-Dorg.gradle.java.home`::
Set JDK home dir.

[[sec:command_line_bootstrapping_projects]]
== Bootstrapping new projects

=== Creating new Gradle builds
Use the built-in `gradle init` task to create a new Gradle builds, with new or existing projects.

----
$ gradle init
----

Most of the time you'll want to specify a project type. Available types include `basic` (default), `java-library`, `java-application`, and more. See <<build_init_plugin.adoc#build_init_plugin, init plugin documentation>> for details.

----
$ gradle init --type java-library
----

=== Standardize and provision Gradle
The built-in `gradle wrapper` task generates a script, `gradlew`, that invokes a declared version of Gradle, downloading it beforehand if necessary.

----
$ gradle wrapper --gradle-version=4.4
----

You can also specify `--distribution-type=(bin|all)`, `--gradle-distribution-url`, `--gradle-distribution-sha256-sum` in addition to `--gradle-version`. Full details on how to use these options are documented in the <<gradle_wrapper.adoc#gradle_wrapper,Gradle wrapper section>>.

[[sec:continuous_build]]
== Continuous Build

Continuous Build allows you to automatically re-execute the requested tasks when task inputs change.

For example, you can continuously run the `test` task and all dependent tasks by running:

----
$ gradle test --continuous
----

Gradle will behave as if you ran `gradle test` after a change to sources or tests that contribute to the requested tasks. This means that unrelated changes (such as changes to build scripts) will not trigger a rebuild. In order to incorporate build logic changes, the continuous build must be restarted manually.

=== Terminating Continuous Build

If Gradle is attached to an interactive input source, such as a terminal, the continuous build can be exited by pressing `CTRL-D` (On Microsoft Windows, it is required to also press `ENTER` or `RETURN` after `CTRL-D`). If Gradle is not attached to an interactive input source (e.g. is running as part of a script), the build process must be terminated (e.g. using the `kill` command or similar). If the build is being executed via the Tooling API, the build can be cancelled using the Tooling API's cancellation mechanism.

[[continuous_build_limitations]]
=== Limitations and quirks

There are several issues to be aware with the current implementation of continuous build. These are likely to be addressed in future Gradle releases.

[[sec:build_cycles]]
==== Build cycles

Gradle starts watching for changes just before a task executes. If a task modifies its own inputs while executing, Gradle will detect the change and trigger a new build. If every time the task executes, the inputs are modified again, the build will be triggered again. This isn't unique to continuous build. A task that modifies its own inputs will never be considered up-to-date when run "normally" without continuous build.

If your build enters a build cycle like this, you can track down the task by looking at the list of files reported changed by Gradle. After identifying the file(s) that are changed during each build, you should look for a task that has that file as an input. In some cases, it may be obvious (e.g., a Java file is compiled with `compileJava`). In other cases, you can use `--info` logging to find the task that is out-of-date due to the identified files.

[[sec:continuous_build_limitations_jdk9]]
==== Restrictions with Java 9

Due to class access restrictions related to Java 9, Gradle cannot set some operating system specific options, which means that:

* On macOS, Gradle will poll for file changes every 10 seconds instead of every 2 seconds.
* On Windows, Gradle must use individual file watches (like on Linux/Mac OS), which may cause continuous build to no longer work on very large projects.

[[sec:performance_and_stability]]
==== Performance and stability

The JDK file watching facility relies on inefficient file system polling on macOS (see: https://bugs.openjdk.java.net/browse/JDK-7133447[JDK-7133447]). This can significantly delay notification of changes on large projects with many source files.

Additionally, the watching mechanism may deadlock under _heavy_ load on macOS (see: https://bugs.openjdk.java.net/browse/JDK-8079620[JDK-8079620]). This will manifest as Gradle appearing not to notice file changes. If you suspect this is occurring, exit continuous build and start again.

On Linux, OpenJDK's implementation of the file watch service can sometimes miss file system events (see: https://bugs.openjdk.java.net/browse/JDK-8145981[JDK-8145981]).

[[sec:changes_to_symbolic_links]]
==== Changes to symbolic links

 * Creating or removing symbolic link to files will initiate a build.
 * Modifying the target of a symbolic link will not cause a rebuild.
 * Creating or removing symbolic links to directories will not cause rebuilds.
 * Creating new files in the target directory of a symbolic link will not cause a rebuild.
 * Deleting the target directory will not cause a rebuild.

[[sec:changes_to_build_logic_are_not_considered]]
==== Changes to build logic are not considered

The current implementation does not recalculate the build model on subsequent builds. This means that changes to task configuration, or any other change to the build model, are effectively ignored.


point to sdk page

point to sdk page

* xref:sdk.adoc[SDK]
** Video Tutorials
*** SDK Use Case Tutorials
****  link:http://www.youtube.com/watch?v=-OzRZscLlHY[Demo 1 (Quixote demo)]
****  link:http://www.youtube.com/watch?v=6-YWxD3JByE[Demo 2 (Models and Materials)]
*** SDK Tutorials
****  link:http://www.youtube.com/watch?v=M1_0pbeyJzI[Basics]
****  link:http://www.youtube.com/watch?v=nL7woH40i5c[Importing Models]
****  link:http://www.youtube.com/watch?v=DUmgAjiNzhY[Dragging&Dropping Nodes]
****  link:http://www.youtube.com/watch?v=ntPAmtsQ6eM[Scene Composing]
****  link:http://www.youtube.com/watch?v=zgPV3W6dD4s[Terrain with Collision Shape]
****  link:http://www.youtube.com/watch?v=Feu3-mrpolc[Working with Materials]
****  link:http://www.youtube.com/watch?v=MNDiZ9YHIpM[Custom Controls]
****  link:http://www.youtube.com/watch?v=oZnssg8TBWQ[WebStart Deployment]
****  link:http://www.youtube.com/watch?v=D7JM4VMKqPc[Animation and Effect TrackEditing]
** Getting Started
***  xref:update_center.adoc[Updating jMonkeyEngine SDK]
***  xref:troubleshooting.adoc[Troubleshooting]
** Java Development Features
***  xref:project_creation.adoc[Project Creation]
***  xref:code_editor.adoc[Code Editor and Palette]
***  xref:version_control.adoc[File Version Control]
***  xref:debugging_profiling_testing.adoc[Debug, Profile, Test]
***  xref:application_deployment.adoc[Application Deployment]
****  xref:default_build_script.adoc[Default Build Script]
****  xref:android.adoc[Android]
****  xref:ios.adoc[iOS]
** Unique Features
***  xref:model_loader_and_viewer.adoc[Import, View, Convert Models]
****  xref:asset_packs.adoc[Asset Packs]
***  xref:scene_explorer.adoc[The SceneExplorer]
***  xref:scene_composer.adoc[Composing a Scene]
***  xref:terrain_editor.adoc[Terrain Editor]
***  xref:sample_code.adoc[Sample Code]
***  xref:material_editing.adoc[Material Editing]
***  xref:font_creation.adoc[Creating Bitmap Fonts]
***  link:https://hub.jmonkeyengine.org/t/effecttrack-and-audiotrack-editing-in-the-sdk/23378[Audio and Effect Track Editing]
****  link:https://www.youtube.com/watch?v=D7JM4VMKqPc[Video: Effect and AudioTrack editing in jMonkeyEngine 3 sdk]
//*  <<sdk/attachment_bones#,Animation and Attachment Bones Editing>>
***  xref:filters.adoc[Post-Processor Filter Editor and Viewer]
//*  <<sdk/blender#,Blender Importer>>
***  xref:ROOT:jme3/advanced/application_states.adoc[Application States]
***  xref:ROOT:jme3/advanced/custom_controls.adoc[Custom Controls]
***  xref:vehicle_creator.adoc[Vehicle Creator]
** Advanced Usage
***  xref:use_own_jme#.adoc[Using your own (modified) version of jME3 in jMonkeyEngine SDK]
***  xref:development/model_loader.adoc[Create a custom model importer]
***  xref:increasing_heap_memory.adoc[Increasing Heap Memory]
** Available external plugins
***  xref:ROOT:jme3/contributions.adoc[Contributions]
***  xref:neotexture.adoc[Neo Texture Editor for procedural textures]
***  link:http://www.youtube.com/watch?v=yS9a9o4WzL8[Video: Mesh Tool & Physics Editor]
** Development
***  xref:build_platform.adoc[Building jMonkeyEngine SDK]
***  xref:development.adoc[Developing plugins for jMonkeyEngine SDK]

* xref:sdk.adoc[SDK]
** Video Tutorials
*** SDK Use Case Tutorials
****  link:http://www.youtube.com/watch?v=-OzRZscLlHY[Demo 1 (Quixote demo)]
****  link:http://www.youtube.com/watch?v=6-YWxD3JByE[Demo 2 (Models and Materials)]
*** SDK Tutorials
****  link:http://www.youtube.com/watch?v=M1_0pbeyJzI[Basics]
****  link:http://www.youtube.com/watch?v=nL7woH40i5c[Importing Models]
****  link:http://www.youtube.com/watch?v=DUmgAjiNzhY[Dragging&Dropping Nodes]
****  link:http://www.youtube.com/watch?v=ntPAmtsQ6eM[Scene Composing]
****  link:http://www.youtube.com/watch?v=zgPV3W6dD4s[Terrain with Collision Shape]
****  link:http://www.youtube.com/watch?v=Feu3-mrpolc[Working with Materials]
****  link:http://www.youtube.com/watch?v=MNDiZ9YHIpM[Custom Controls]
****  link:http://www.youtube.com/watch?v=oZnssg8TBWQ[WebStart Deployment]
****  link:http://www.youtube.com/watch?v=D7JM4VMKqPc[Animation and Effect TrackEditing]
** Getting Started
***  xref:update_center.adoc[Updating jMonkeyEngine SDK]
***  xref:troubleshooting.adoc[Troubleshooting]
** Java Development Features
***  xref:project_creation.adoc[Project Creation]
***  xref:code_editor.adoc[Code Editor and Palette]
***  xref:version_control.adoc[File Version Control]
***  xref:debugging_profiling_testing.adoc[Debug, Profile, Test]
***  xref:application_deployment.adoc[Application Deployment]
****  xref:default_build_script.adoc[Default Build Script]
****  xref:android.adoc[Android]
****  xref:ROOT:jme3/ios.adoc[iOS]
** Unique Features
***  xref:model_loader_and_viewer.adoc[Import, View, Convert Models]
****  xref:asset_packs.adoc[Asset Packs]
***  xref:scene_explorer.adoc[The SceneExplorer]
***  xref:scene_composer.adoc[Composing a Scene]
***  xref:terrain_editor.adoc[Terrain Editor]
***  xref:sample_code.adoc[Sample Code]
***  xref:material_editing.adoc[Material Editing]
***  xref:font_creation.adoc[Creating Bitmap Fonts]
***  link:https://hub.jmonkeyengine.org/t/effecttrack-and-audiotrack-editing-in-the-sdk/23378[Audio and Effect Track Editing]
****  link:https://www.youtube.com/watch?v=D7JM4VMKqPc[Video: Effect and AudioTrack editing in jMonkeyEngine 3 sdk]
//*  <<sdk/attachment_bones#,Animation and Attachment Bones Editing>>
***  xref:filters.adoc[Post-Processor Filter Editor and Viewer]
//*  <<sdk/blender#,Blender Importer>>
***  xref:ROOT:jme3/advanced/application_states.adoc[Application States]
***  xref:ROOT:jme3/advanced/custom_controls.adoc[Custom Controls]
***  xref:vehicle_creator.adoc[Vehicle Creator]
** Advanced Usage
***  xref:use_own_jme#.adoc[Using your own (modified) version of jME3 in jMonkeyEngine SDK]
***  xref:development/model_loader.adoc[Create a custom model importer]
***  xref:increasing_heap_memory.adoc[Increasing Heap Memory]
** Available external plugins
***  xref:ROOT:jme3/contributions.adoc[Contributions]
***  xref:neotexture.adoc[Neo Texture Editor for procedural textures]
***  link:http://www.youtube.com/watch?v=yS9a9o4WzL8[Video: Mesh Tool & Physics Editor]
** Development
***  xref:build_platform.adoc[Building jMonkeyEngine SDK]
***  xref:development.adoc[Developing plugins for jMonkeyEngine SDK]


Update installation-guide.adoc

Update installation-guide.adoc

= Build a local Version of OLS
:doctype: book
:toc: left
:toc-title: OLS Installation
:sectanchors:
:sectlinks:
:toclevels: 4
:source-highlighter: highlightjs

[[Introduction]]
== Introduction
The OLS (http://www.ebi.ac.uk/ols ) aims to be a comprehensive collection of biomedical ontologies for the life sciences. OLS is open source and therefore can be downloaded and used for your own projects. This guide should help with the installation of a local version of OLS.

== Premise: Software requirements
In order to be able to run OLS, there are some Software requirements that have to be fulfilled and therefore installed locally. There are multiple ways to install the relevant software and of course the exact way depends on the OS you use. For Mac OS one way to go is homebrew.

|=======
| *Software* | *Description* | *Installation with homebrew (OS X)*
| java 1.8 | development language | _(no direct homebrew support)_
| maven 3+ | dependency manager/build environment | brew install maven
| tomcat 7.5+ | webserver | brew install tomcat
| mongodb (2.7.8+) | database | brew install mongodb
| solr 5.2.1+ | Indxing/search engine | brew install solr
|=======

NOTE: Java, maven, mongodb and solr should be available in the environment, so make sure the relevant environment variable is set! If you installed the software via a 'package manager', this might have been done automatically.

== Obtaining the source code
Download the source code from the OLS github repository https://github.com/EBISPOT/OLS alternativly (if git is installed), you can of course clone the repository with `git clone https://github.com/EBISPOT/OLS.git`

== Configurations
The default configuration for OLS can be found at `OLS/ols-apps/ols-config-importer/src/main/resources/ols-config.yaml`

Example configuration file:
**********************
## EFO +
# * are required fields

*id:* efo  // short unique id for the ontology * +
*preferredPrefix:* EFO	// preferred display name for the ontology +
*title:* Experimental Factor Ontology // Short title of the ontology +
*uri:* http://www.ebi.ac.uk/efo // The ontology URI *
*description:* "The Experimental Factor Ontology (EFO) provides a..." // Full ontology description +
*ontology_purl:* http://www.ebi.ac.uk/efo/efo.owl  // URL to get the ontology from * +
*homepage:* http://www.ebi.ac.uk/efo  // homepage of the ontology +
*mailing_list:* efo-users@lists.sourceforge.net // assocaited mailing list +
*definition_property:* // predicates that are used for term definitions +
    -- http://www.ebi.ac.uk/efo/definition +
*synonym_property:* // prediates used for synonyms +
    -- http://www.ebi.ac.uk/efo/alternative_term +
*hierarchical_property:* // predicates that are hierarchical (like part of) will be included in default tree view +
     -- http://purl.obolibrary.org/obo/BFO_0000050 +
     -- http://purl.obolibrary.org/obo/RO_0002202 +
*hidden_property:* // any predicates that should be ignored when indexing +
     -- http://www.ebi.ac.uk/efo/has_flag +
*base_uri:* // base URIs for local terms +
     -- http://www.ebi.ac.uk/efo/EFO_ +
*reasoner:* OWL2 // can be one of OWL2, EL, NONE - deafult is EL +
*oboSlims:* false   // contains OBO style slim annotations +
**********************

OLS is also able to import Yaml files following the OBO foundry specification. By default it will load the OBO config from the classpath. If you don't want the OBO ontologies delete or rename the obo-config.yaml file. You may also need to comment out the property from the `git/OLS/ols-apps/ols-config-importer/src/main/resources/application.properties` file (`ols.obofoundry.ontology.config`)
https://raw.githubusercontent.com/OBOFoundry/OBOFoundry.github.io/master/_config.yml

== Building OLS
You can build your version of OLS by using maven. Go to your local OLS folder and execute

`mvn clean install`

After a successful build process, this should create target folders.

== Initializing OLS (Loading and indexing resources/ontologies)
=== Loading the configuration files into MongoDB
In order to be able to load and index data in OLS, the MongoDB as well as Solr have to be available, so they need to be up and running. In contrast to that, the local tomcat server has to be down before running the `ols-indexer.jar`

OLS uses mongodb to persist ontology configuration. To load the ontology configuration into your mongodb database, first make sure your mongo database is running.

To invoke the import process with different options, for example because you changed it, you can run the file ols-config-importer.jar (`java -jar ols-config-importer.jar`) in the folder `OLS/ols-apps/ols-config-importer/target`.

NOTE: OLS uses default mongo connection option. You can overide any of these by editing the application.properties file in the git/OLS/ols-apps/ols-config-importer/src/main/resources/application.properties file.

----------------
# MONGODB (MongoProperties)
spring.data.mongodb.authentication-database= # Authentication database name.
spring.data.mongodb.database=test # Database name.
spring.data.mongodb.field-naming-strategy= # Fully qualified name of the FieldNamingStrategy to use.
spring.data.mongodb.grid-fs-database= # GridFS database name.
spring.data.mongodb.host=localhost # Mongo server host.
spring.data.mongodb.password= # Login password of the mongo server.
spring.data.mongodb.port=27017 # Mongo server port.
spring.data.mongodb.repositories.enabled=true # Enable Mongo repositories.
spring.data.mongodb.uri=mongodb://localhost/test # Mongo database URI. When set, host and port are ignored.
spring.data.mongodb.username= # Login user of the mongo server.
----------------

At this point the config should be loaded into your mongo db database called ols and a document collection called olsadmin.

If you need to update any config or reload the config, simply re-run the config-loader.jar as required.

=== Building the Neo4J and SOLR indexes
OLS provides a single application for indexing ontologies. When run this program does a few things:

---

1. Read ontologies from the config loaded into the MongoDB
2. Download each file to a local directory
a. If this is the first time it will set the ontology status to 'TO LOAD' in the mongo database.
b. If this is run a subsequent time it will check the latest download to the last file it downloaded. If these files are different it will set the ontology status 'TOLOAD' in the mongo database.
3. All ontologies in the mongo database that have status 'TOLOAD' will get stored in both the SOLR and Neo4J index. Any older versions indexed will be deleted first.

---

For this to work you need to make sure your Mongo and SOLR servers are running. You don't need a Neo4J server as OLS uses an embedded Neo4J database. If you already have a tomcat server running with OLS deployed and it is using the same index files as SOLR and Neo4J, it is advised to shutdown the tomcat before running this script.

To invoke the indexer process you can run the file ols-loading-app.jar (`java -jar ols-loading-app.jar`) in the folder OLS/ols-apps/ols-loading-app/target.

This script has two optional arguments:

* -f <list of ontologies> : Used to force the reload of a particular ontology
* -off : Used to run in offline mode, ontologies will not be downloaded from the Web.

Additional configuration can be specified in the `application.properties` file before compilation or using the ``-D<propertyname>=<value>` at runtime.

----------------
spring.data.mongodb.database ols # mongo db name, default is ols

# SOLR (SolrProperties)
spring.data.solr.host=http://127.0.0.1:8983/solr # Solr host. Ignored if "zk-host" is set.
ols.solr.search.core ontology
ols.solr.suggest.core autosuggest

#Mongo DB properties same as above
----------------

By default OLS will use ~/.ols as the working directory for OLS where files will be downloaded and Neo4J indexes will be created. You can override this by setting the $OLS_HOME environment variable to a custom directory. You can also override this by passing the ``-Dols.home=` argument to any of the scripts.

Providing this script has run successfully, you can rerun this script to update the OLS indexes. Each time you run it it will fetch the latest ontologies and only index the ones that have changed. Remember to shut down the tomcat before running this app.

== Deploying the app on local server
To deploy OLS on the local server, it is necessary to copy certain .war files from the OLS-web target directory (`OLS/ols-web/target`) into the webapps folder of the local tomcat server. After starting tomcat (via `startup.sh` in the bin folder), there should be a local version of OLS running at http://localhost:8080/ols-boot.

Any configuration can be overridden using the same properties above. Put them in the application.properties file in the `ols-web/src/main/resource/application.properties` file before compiling that jar.

= Build a local Version of OLS
:doctype: book
:toc: left
:toc-title: OLS Installation
:sectanchors:
:sectlinks:
:toclevels: 4
:source-highlighter: highlightjs

[[Introduction]]
== Introduction
The OLS (http://www.ebi.ac.uk/ols ) aims to be a comprehensive collection of biomedical ontologies for the life sciences. OLS is open source and therefore can be downloaded and used for your own projects. This guide should help with the installation of a local version of OLS.

== Premise: Software requirements
In order to be able to run OLS, there are some Software requirements that have to be fulfilled and therefore installed locally. There are multiple ways to install the relevant software and of course the exact way depends on the OS you use. For Mac OS one way to go is homebrew.

|=======
| *Software* | *Description* | *Installation with homebrew (OS X)*
| java 1.8 | development language | _(no direct homebrew support)_
| maven 3+ | dependency manager/build environment | brew install maven
| tomcat 7.5+ | webserver | brew install tomcat
| mongodb (2.7.8+) | database | brew install mongodb
| solr 5.2.1+ | Indxing/search engine | brew install solr
|=======

NOTE: Java, maven, mongodb and solr should be available in the environment, so make sure the relevant environment variable is set! If you installed the software via a 'package manager', this might have been done automatically.

== Obtaining the source code
Download the source code from the OLS github repository https://github.com/EBISPOT/OLS alternativly (if git is installed), you can of course clone the repository with `git clone https://github.com/EBISPOT/OLS.git`

== Configurations
The default configuration for OLS can be found at `OLS/ols-apps/ols-config-importer/src/main/resources/ols-config.yaml`

Example configuration file:
**********************
## EFO +
# * are required fields

*id:* efo  // short unique id for the ontology * +
*preferredPrefix:* EFO	// preferred display name for the ontology +
*title:* Experimental Factor Ontology // Short title of the ontology +
*uri:* http://www.ebi.ac.uk/efo // The ontology URI *
*description:* "The Experimental Factor Ontology (EFO) provides a..." // Full ontology description +
*ontology_purl:* http://www.ebi.ac.uk/efo/efo.owl  // URL to get the ontology from * +
*homepage:* http://www.ebi.ac.uk/efo  // homepage of the ontology +
*mailing_list:* efo-users@lists.sourceforge.net // assocaited mailing list +
*definition_property:* // predicates that are used for term definitions +
    -- http://www.ebi.ac.uk/efo/definition +
*synonym_property:* // prediates used for synonyms +
    -- http://www.ebi.ac.uk/efo/alternative_term +
*hierarchical_property:* // predicates that are hierarchical (like part of) will be included in default tree view +
     -- http://purl.obolibrary.org/obo/BFO_0000050 +
     -- http://purl.obolibrary.org/obo/RO_0002202 +
*hidden_property:* // any predicates that should be ignored when indexing +
     -- http://www.ebi.ac.uk/efo/has_flag +
*base_uri:* // base URIs for local terms +
     -- http://www.ebi.ac.uk/efo/EFO_ +
*reasoner:* OWL2 // can be one of OWL2, EL, NONE - deafult is EL
*isInferred:* false // if true no reasoner will be used +
*oboSlims:* false   // contains OBO style slim annotations +
**********************

OLS is also able to import Yaml files following the OBO foundry specification. By default it will load the OBO config from the classpath. If you don't want the OBO ontologies delete or rename the obo-config.yaml file. You may also need to comment out the property from the `git/OLS/ols-apps/ols-config-importer/src/main/resources/application.properties` file (`ols.obofoundry.ontology.config`)
https://raw.githubusercontent.com/OBOFoundry/OBOFoundry.github.io/master/_config.yml

== Building OLS
You can build your version of OLS by using maven. Go to your local OLS folder and execute

`mvn clean install`

After a successful build process, this should create target folders.

== Initializing OLS (Loading and indexing resources/ontologies)
=== Loading the configuration files into MongoDB
In order to be able to load and index data in OLS, the MongoDB as well as Solr have to be available, so they need to be up and running. In contrast to that, the local tomcat server has to be down before running the `ols-indexer.jar`

OLS uses mongodb to persist ontology configuration. To load the ontology configuration into your mongodb database, first make sure your mongo database is running.

To invoke the import process with different options, for example because you changed it, you can run the file ols-config-importer.jar (`java -jar ols-config-importer.jar`) in the folder `OLS/ols-apps/ols-config-importer/target`.

NOTE: OLS uses default mongo connection option. You can overide any of these by editing the application.properties file in the git/OLS/ols-apps/ols-config-importer/src/main/resources/application.properties file.

----------------
# MONGODB (MongoProperties)
spring.data.mongodb.authentication-database= # Authentication database name.
spring.data.mongodb.database=test # Database name.
spring.data.mongodb.field-naming-strategy= # Fully qualified name of the FieldNamingStrategy to use.
spring.data.mongodb.grid-fs-database= # GridFS database name.
spring.data.mongodb.host=localhost # Mongo server host.
spring.data.mongodb.password= # Login password of the mongo server.
spring.data.mongodb.port=27017 # Mongo server port.
spring.data.mongodb.repositories.enabled=true # Enable Mongo repositories.
spring.data.mongodb.uri=mongodb://localhost/test # Mongo database URI. When set, host and port are ignored.
spring.data.mongodb.username= # Login user of the mongo server.
----------------

At this point the config should be loaded into your mongo db database called ols and a document collection called olsadmin.

If you need to update any config or reload the config, simply re-run the config-loader.jar as required.

=== Building the Neo4J and SOLR indexes
OLS provides a single application for indexing ontologies. When run this program does a few things:

---

1. Read ontologies from the config loaded into the MongoDB
2. Download each file to a local directory
a. If this is the first time it will set the ontology status to 'TO LOAD' in the mongo database.
b. If this is run a subsequent time it will check the latest download to the last file it downloaded. If these files are different it will set the ontology status 'TOLOAD' in the mongo database.
3. All ontologies in the mongo database that have status 'TOLOAD' will get stored in both the SOLR and Neo4J index. Any older versions indexed will be deleted first.

---

For this to work you need to make sure your Mongo and SOLR servers are running. You don't need a Neo4J server as OLS uses an embedded Neo4J database. If you already have a tomcat server running with OLS deployed and it is using the same index files as SOLR and Neo4J, it is advised to shutdown the tomcat before running this script.

To invoke the indexer process you can run the file ols-loading-app.jar (`java -jar ols-loading-app.jar`) in the folder OLS/ols-apps/ols-loading-app/target.

This script has two optional arguments:

* -f <list of ontologies> : Used to force the reload of a particular ontology
* -off : Used to run in offline mode, ontologies will not be downloaded from the Web.

Additional configuration can be specified in the `application.properties` file before compilation or using the ``-D<propertyname>=<value>` at runtime.

----------------
spring.data.mongodb.database ols # mongo db name, default is ols

# SOLR (SolrProperties)
spring.data.solr.host=http://127.0.0.1:8983/solr # Solr host. Ignored if "zk-host" is set.
ols.solr.search.core ontology
ols.solr.suggest.core autosuggest

#Mongo DB properties same as above
----------------

By default OLS will use ~/.ols as the working directory for OLS where files will be downloaded and Neo4J indexes will be created. You can override this by setting the $OLS_HOME environment variable to a custom directory. You can also override this by passing the ``-Dols.home=` argument to any of the scripts.

Providing this script has run successfully, you can rerun this script to update the OLS indexes. Each time you run it it will fetch the latest ontologies and only index the ones that have changed. Remember to shut down the tomcat before running this app.

== Deploying the app on local server
To deploy OLS on the local server, it is necessary to copy certain .war files from the OLS-web target directory (`OLS/ols-web/target`) into the webapps folder of the local tomcat server. After starting tomcat (via `startup.sh` in the bin folder), there should be a local version of OLS running at http://localhost:8080/ols-boot.

Any configuration can be overridden using the same properties above. Put them in the application.properties file in the `ols-web/src/main/resource/application.properties` file before compiling that jar.