Skip to content
Newer
Older
100644 59 lines (50 sloc) 1.45 KB
7995c9f @graemerocher ignoring test temporarily, as due to infrastructure issues it is not …
graemerocher authored
1 /*
2 * Copyright 2004-2005 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 */
16
17 /**
18 * @author Graeme Rocher
19 * @since 2.1
20 */
21
22 import org.codehaus.groovy.grails.cli.maven.MavenPomGenerator
23
24 includeTargets << grailsScript("_GrailsArgParsing")
25 target(default: "Creates a POM for a Grails project") {
26 depends(parseArguments)
27
28 if (!argsMap.params) {
29 println msg()
30 exit 1
31 }
32
33 def generator = new MavenPomGenerator(grailsSettings)
34 try {
35 def group = argsMap.params[0]?.trim()
36 if(group) {
37 generator.generate group
38 grailsConsole.addStatus "POM generated."
39 }
40 else {
41 println msg()
42 exit 1
43 }
44
45 }
46 catch(e) {
47 grailsConsole.error "Error occurred creating POM: ${e.message}", e
48 exit 1
49 }
50
51 }
52
53 String msg() {
54 return '''\
55 Usage: grails create-pom <group>
56 Example: grails create-pom com.mycompany
57 '''
58 }
Something went wrong with that request. Please try again.