Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 41 lines (36 sloc) 1.283 kb
bc5c63e @graemerocher allow JVM to exit with forked run-app and add new stop-app command to st...
graemerocher authored
1 /*
2 * Copyright 2012 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
27b5b04 whitespace, misc cleanup
Burt Beckwith authored
16
bc5c63e @graemerocher allow JVM to exit with forked run-app and add new stop-app command to st...
graemerocher authored
17 /**
27b5b04 whitespace, misc cleanup
Burt Beckwith authored
18 * Stops the forked Grails application if it is running.
19 *
20 * @author Graeme Rocher
21 *
22 * @since 2.2
23 */
bc5c63e @graemerocher allow JVM to exit with forked run-app and add new stop-app command to st...
graemerocher authored
24
25 includeTargets << grailsScript("_GrailsRun")
26
27 target('default': "Stops a forked Grails application") {
28 depends(checkVersion, configureProxy)
27b5b04 whitespace, misc cleanup
Burt Beckwith authored
29
bc5c63e @graemerocher allow JVM to exit with forked run-app and add new stop-app command to st...
graemerocher authored
30 try {
31 grailsConsole.updateStatus "Stopping Grails Server..."
32 def url = "http://${serverHost ?: 'localhost'}:${serverPort+1}"
33 grailsConsole.verbose "URL to stop server is $url"
34 new URL(url).getText(connectTimeout: 10000, readTimeout: 10000)
27b5b04 whitespace, misc cleanup
Burt Beckwith authored
35 grailsConsole.updateStatus "Server Stopped"
bc5c63e @graemerocher allow JVM to exit with forked run-app and add new stop-app command to st...
graemerocher authored
36 }
37 catch(e) {
27b5b04 whitespace, misc cleanup
Burt Beckwith authored
38 grailsConsole.updateStatus "Server Stopped"
bc5c63e @graemerocher allow JVM to exit with forked run-app and add new stop-app command to st...
graemerocher authored
39 }
27b5b04 whitespace, misc cleanup
Burt Beckwith authored
40 }
Something went wrong with that request. Please try again.