////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you 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

https://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.
////


== stop-app



=== Purpose


Stops a Grails application that was started with the link:{commandLineRef}run-app.html[run-app] command.

NOTE: This command works in development mode only.


=== Examples


[source,groovy]
----
$ grails
grails> run-app
grails> stop-app
----

It can also be run as a separate invocation, including from a different terminal than the one that started the application:

[source,bash]
----
$ grails stop-app
----


=== Description


Use `stop-app` to stop the application for the current project after it has been started with `run-app`. The command can be run from interactive mode or as a separate command from another terminal.

On Linux and macOS the application is shut down gracefully, so JVM shutdown hooks and Spring's orderly shutdown run. On Windows the application is terminated on a best-effort basis and a graceful shutdown is not guaranteed.

If no application started by `run-app` is running for the project, `stop-app` reports that the application is not running.
