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

== create-job

=== Purpose


The `create-job` command creates a new scheduled job for the given base name.


=== Examples

----
grails create-job Scheduled
grails create-job com.example.Scheduled
----

=== Description


Creates a new Quartz scheduled job with an empty 'execute' method. The argument is required.

The name of the job can include a Java package, such as `com.example` in the last example above, but if one is not provided a default is used. So the first example will create the file `grails-app/jobs/<appname>/ScheduledJob.groovy` whereas the second one will create `grails-app/jobs/com/example/ScheduledJob.groovy`. Note that the first letter of the job name is always upper-cased when determining the class name.

If you want the command to default to a different package for jobs, provide a value for `grails.project.groupId` in the link:{guidePath}conf.html#config[runtime configuration].

Note that this command is just for convenience and you can also create jobs in your favourite text editor or IDE if you choose.

Usage:
[source,groovy]
----
grails create-job <<name>>
----
