Skip to content

Commit 51ff1e3

Browse files
committed
Add detailed documentation for default Grails application profiles
Introduces new documentation sections and files for each default Grails application profile, including web, REST API, plugin, web-plugin, rest-api-plugin, and profile profiles. Updates the guide index and table of contents to reference these new sections, providing users with comprehensive information on available profiles, their commands, and features.
1 parent 0c944d3 commit 51ff1e3

File tree

9 files changed

+672
-0
lines changed

9 files changed

+672
-0
lines changed

grails-doc/src/en/guide/index.adoc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,41 @@ include::commandLine/creatingCustomCommands.adoc[]
270270

271271
include::profiles.adoc[]
272272

273+
[[defaultProfiles]]
274+
=== Default Grails Profiles
275+
276+
include::profiles/defaultProfiles.adoc[]
277+
278+
[[webProfile]]
279+
==== Web Profile
280+
281+
include::profiles/webProfile.adoc[]
282+
283+
[[restAPIProfile]]
284+
==== REST API Profile
285+
286+
include::profiles/restAPIProfile.adoc[]
287+
288+
[[pluginProfile]]
289+
==== Plugin Profile
290+
291+
include::profiles/pluginProfile.adoc[]
292+
293+
[[webPluginProfile]]
294+
==== Web Plugin Profile
295+
296+
include::profiles/webPluginProfile.adoc[]
297+
298+
[[restAPIPluginProfile]]
299+
==== REST API Plugin Profile
300+
301+
include::profiles/restAPIPluginProfile.adoc[]
302+
303+
[[profileProfile]]
304+
==== Profile Profile
305+
306+
include::profiles/profileProfile.adoc[]
307+
273308
[[creatingProfiles]]
274309
=== Creating Profiles
275310

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
////
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
https://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
////
19+
20+
Grails provides a set of default application profiles that serve as foundational templates for generating various types of projects.
21+
These profiles encapsulate specific commands, templates, plugins, and configurations tailored to different development needs, allowing developers to quickly generate applications or plugins with predefined structures.
22+
The profiles are resolved from Maven Central by default.
23+
24+
Default profiles include `base`, `web`, `rest-api`, `plugin`, `web-plugin`, `rest-api-plugin` and `profile`. Most extend from other profiles to promote reusability and consistency.
25+
26+
Available profiles can be listed, when not inside a Grails' project directory:
27+
28+
[source,bash]
29+
----
30+
$ grails list-plugins
31+
----
32+
33+
[source,bash]
34+
----
35+
| Available Profiles
36+
--------------------
37+
* base - The base profile extended by other profiles
38+
* plugin - Profile for plugins designed to work across all profiles
39+
* profile - A profile for creating new Grails profiles
40+
* rest-api - Profile for REST API applications
41+
* rest-api-plugin - Profile for REST API plugins
42+
* web - Profile for Web applications
43+
* web-plugin - Profile for Plugins designed for Web applications
44+
----
45+
46+
The `base` profile acts as the foundational layer extended by most other profiles, providing essential skeleton directories, core dependencies, and basic commands that form the backbone of any Grails project.
47+
It ensures a standardized starting point without imposing specific application paradigms.
48+
49+
For application development, the `web` profile is the default when creating a new Grails app, optimized for full-stack web applications with features like GSP views, controllers, and the asset pipeline.
50+
The `rest-api` profile, on the other hand, targets REST API-centric projects, emphasizing RESTful endpoints, JSON handling, and configurations suitable for backend services.
51+
52+
The `plugin` profile is designed for creating reusable plugins that can integrate across various Grails applications.
53+
Similarly, the `web-plugin` profile focuses on plugins tailored specifically for web applications, inheriting from the web and plugin profiles.
54+
The `rest-api-plugin` profile is specialized for developing plugins that provide REST API functionality, inheriting from the rest-api and plugin profiles, enabling the creation of modular, reusable components focused on API endpoints.
55+
56+
Lastly, the `profile` profile is intended for developers creating custom profiles.
57+
58+
These profiles collectively enable flexible project generation while maintaining Grails' convention-over-configuration philosophy.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
////
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
https://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
////
19+
20+
To create an application using the `plugin` profile:
21+
22+
[source, bash]
23+
----
24+
grails create-plugin myplugin
25+
----
26+
27+
The above statement is equivalent to:
28+
29+
[source, bash]
30+
----
31+
grails create-app myplugin --profile=plugin
32+
----
33+
34+
To get information about the profile and available features, when not inside a Grails' project directory:
35+
36+
[source, bash]
37+
----
38+
grails profile-info plugin
39+
----
40+
41+
You will see an output similar to:
42+
43+
[source, bash]
44+
----
45+
Profile: plugin
46+
--------------------
47+
Profile for plugins designed to work across all profiles
48+
49+
Provided Commands:
50+
--------------------
51+
* install - Installs a plugin into the local Maven cache
52+
* package-plugin - Packages the plugin into a JAR file
53+
* publish-plugin - Publishes the plugin to the Grails central repository
54+
* help - Prints help information for a specific command
55+
* url-mappings-report - Prints out a report of the project's URL mappings
56+
* open - Opens a file in the project
57+
* gradle - Allows running of Gradle tasks
58+
* clean - Cleans a Grails application's compiled sources
59+
* compile - Compiles a Grails application
60+
* create-command - Creates an Application Command
61+
* create-domain-class - Creates a Domain Class
62+
* create-unit-test - Creates a unit test
63+
* assemble - Creates a JAR or WAR archive for production deployment
64+
* test-app - Runs the applications tests
65+
* run-command - Executes Grails commands
66+
* console - Runs the Grails interactive console
67+
* run-script - Executes Groovy scripts in a Grails context
68+
* stop-app - Stops the running Grails application
69+
* stats - Prints statistics about the project
70+
* plugin-info - Prints information about the given plugin
71+
* create-script - Creates a Grails script
72+
* bug-report - Creates a zip file that can be attached to issue reports for the current project
73+
* run-app - Runs a Grails application
74+
* dependency-report - Prints out the Grails application's dependencies
75+
* list-plugins - Lists available plugins from the Plugin Repository
76+
* shell - Runs the Grails interactive shell
77+
78+
Provided Features:
79+
--------------------
80+
* asset-pipeline-plugin - Adds Asset Pipeline to a Grails Plugin for packaging
81+
* maven-publish - Publish Artifacts to Maven Central
82+
* asset-pipeline - Adds Asset Pipeline to a Grails project
83+
* events - Adds support for the Grails EventBus abstraction
84+
* geb2 - Adds Geb dependencies to run functional tests.
85+
* gsp - Adds support for GSP to the project
86+
* hibernate5 - Adds GORM for Hibernate 5 to the project
87+
* json-views - Adds support for JSON Views to the project
88+
* less-asset-pipeline - Adds LESS Transpiler Asset Pipeline to a Grails project
89+
* markup-views - Adds support for Markup Views to the project
90+
* mongodb - Adds GORM for MongoDB to the project
91+
* neo4j - Adds GORM for Neo4j to the project
92+
* rx-mongodb - Adds RxGORM for MongoDB to the project
93+
----
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
////
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
https://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
////
19+
20+
To create an application using the `profile` profile:
21+
22+
[source, bash]
23+
----
24+
grails create-profile myprofile
25+
----
26+
27+
The above statement is equivalent to:
28+
29+
[source, bash]
30+
----
31+
grails create-app myprofile --profile=profile
32+
----
33+
34+
To get information about the profile and available features, when not inside a Grails' project directory:
35+
36+
[source, bash]
37+
----
38+
grails profile-info profile
39+
----
40+
41+
You will see an output similar to:
42+
43+
[source, bash]
44+
----
45+
Profile: profile
46+
--------------------
47+
A profile for creating new Grails profiles
48+
49+
Provided Commands:
50+
--------------------
51+
* install - Installs a profile into the local Maven cache
52+
* help - Prints help information for a specific command
53+
* url-mappings-report - Prints out a report of the project's URL mappings
54+
* open - Opens a file in the project
55+
* gradle - Allows running of Gradle tasks
56+
* clean - Cleans a Grails application's compiled sources
57+
* compile - Compiles a Grails application
58+
* create-command - Creates a new command for the profile
59+
* create-domain-class - Creates a Domain Class
60+
* create-unit-test - Creates a unit test
61+
* assemble - Creates a JAR or WAR archive for production deployment
62+
* test-app - Runs the applications tests
63+
* run-command - Executes Grails commands
64+
* console - Runs the Grails interactive console
65+
* run-script - Executes Groovy scripts in a Grails context
66+
* stop-app - Stops the running Grails application
67+
* stats - Prints statistics about the project
68+
* plugin-info - Prints information about the given plugin
69+
* create-script - Creates a Grails script
70+
* bug-report - Creates a zip file that can be attached to issue reports for the current project
71+
* run-app - Runs a Grails application
72+
* dependency-report - Prints out the Grails application's dependencies
73+
* list-plugins - Lists available plugins from the Plugin Repository
74+
* shell - Runs the Grails interactive shell
75+
* create-creator-command - Creates a new create-* command for the profile
76+
* create-feature - Creates a new profile feature
77+
* create-generator-command - Creates a new generate-* command for the profile
78+
* create-template - Creates a new template for the profile
79+
* create-gradle-command - Creates a new command that invokes Gradle for the profile
80+
81+
Provided Features:
82+
--------------------
83+
* asset-pipeline - Adds Asset Pipeline to a Grails project
84+
* events - Adds support for the Grails EventBus abstraction
85+
* geb2 - Adds Geb dependencies to run functional tests.
86+
* gsp - Adds support for GSP to the project
87+
* hibernate5 - Adds GORM for Hibernate 5 to the project
88+
* json-views - Adds support for JSON Views to the project
89+
* less-asset-pipeline - Adds LESS Transpiler Asset Pipeline to a Grails project
90+
* markup-views - Adds support for Markup Views to the project
91+
* mongodb - Adds GORM for MongoDB to the project
92+
* neo4j - Adds GORM for Neo4j to the project
93+
* rx-mongodb - Adds RxGORM for MongoDB to the project
94+
----
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
////
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
https://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
////
19+
20+
To create an application using the `rest-api-plugin` profile:
21+
22+
[source, bash]
23+
----
24+
grails create-app myplugin --profile=rest-api-plugin
25+
----
26+
27+
To get information about the profile and available features, when not inside a Grails' project directory:
28+
29+
[source, bash]
30+
----
31+
grails profile-info rest-api-plugin
32+
----
33+
34+
You will see an output similar to:
35+
36+
[source, bash]
37+
----
38+
Profile: rest-api-plugin
39+
--------------------
40+
Profile for REST API plugins
41+
42+
Provided Commands:
43+
--------------------
44+
* help - Prints help information for a specific command
45+
* url-mappings-report - Prints out a report of the project's URL mappings
46+
* open - Opens a file in the project
47+
* gradle - Allows running of Gradle tasks
48+
* install - Installs a plugin into the local Maven cache
49+
* package-plugin - Packages the plugin into a JAR file
50+
* publish-plugin - Publishes the plugin to the Grails central repository
51+
* clean - Cleans a Grails application's compiled sources
52+
* compile - Compiles a Grails application
53+
* create-command - Creates an Application Command
54+
* create-domain-class - Creates a Domain Class
55+
* create-unit-test - Creates a unit test
56+
* assemble - Creates a JAR or WAR archive for production deployment
57+
* test-app - Runs the applications tests
58+
* run-command - Executes Grails commands
59+
* console - Runs the Grails interactive console
60+
* run-script - Executes Groovy scripts in a Grails context
61+
* stop-app - Stops the running Grails application
62+
* stats - Prints statistics about the project
63+
* plugin-info - Prints information about the given plugin
64+
* create-script - Creates a Grails script
65+
* bug-report - Creates a zip file that can be attached to issue reports for the current project
66+
* run-app - Runs a Grails application
67+
* dependency-report - Prints out the Grails application's dependencies
68+
* list-plugins - Lists available plugins from the Plugin Repository
69+
* shell - Runs the Grails interactive shell
70+
* create-controller - Creates a controller
71+
* create-domain-resource - Creates a domain class that represents a resource
72+
* create-functional-test - Creates an functional test
73+
* create-integration-test - Creates an integration test
74+
* create-interceptor - Creates an interceptor
75+
* create-restful-controller - Creates a REST controller
76+
* create-service - Creates a Service
77+
* generate-all - Generates a controller that performs REST operations
78+
* generate-controller - Generates a controller that performs REST operations
79+
* generate-functional-test - Generates a functional test for a controller that performs REST operations
80+
* generate-views - Generates a controller that performs REST operations
81+
* generate-unit-test - Generates a unit test for a controller that performs REST operations
82+
83+
Provided Features:
84+
--------------------
85+
* asset-pipeline-plugin - Adds Asset Pipeline to a Grails Plugin for packaging
86+
* maven-publish - Publish Artifacts to Maven Central
87+
* asset-pipeline - Adds Asset Pipeline to a Grails project
88+
* events - Adds support for the Grails EventBus abstraction
89+
* geb2 - Adds Geb dependencies to run functional tests.
90+
* gsp - Adds support for GSP to the project
91+
* hibernate5 - Adds GORM for Hibernate 5 to the project
92+
* json-views - Adds support for JSON Views to the project
93+
* less-asset-pipeline - Adds LESS Transpiler Asset Pipeline to a Grails project
94+
* markup-views - Adds support for Markup Views to the project
95+
* mongodb - Adds GORM for MongoDB to the project
96+
* neo4j - Adds GORM for Neo4j to the project
97+
* rx-mongodb - Adds RxGORM for MongoDB to the project
98+
* security - Adds Spring Security REST to the project
99+
----

0 commit comments

Comments
 (0)