Generate project scaffolding based on a template.
Generate project scaffolding based on a template.
(new project & args)
Generate scaffolding for a new project based on a template.
If only one argument is passed to the "new" task, the default template is used and the argument is used as the name of the project.
If two arguments are passed, the first should be the name of a template, and the second is used as the name of the project, for example:
lein new $TEMPLATE_NAME $PROJECT_NAME
To generate to a directory different than your project's name use --to-dir:
lein new $TEMPLATE_NAME $PROJECT_NAME --to-dir $DIR
By default, the "new" task will not write to an existing directory. Supply the --force option to override this behavior:
lein new $TEMPLATE_NAME $PROJECT_NAME --force
lein new $TEMPLATE_NAME $PROJECT_NAME --to-dir $DIR --force
Arguments can be passed to templates by adding them after "new"'s options. Use
--
to separate arguments to lein new and the actual template you are using:
lein new $TEMPLATE_NAME $PROJECT_NAME --to-dir $DIR -- template-arg-1 template-arg-2
If you'd like to use an unreleased (ie, SNAPSHOT) template, pass in --snapshot:
lein new $TEMPLATE_NAME $PROJECT_NAME --snapshot
If you'd rather like to use a specific version of template, specify the version with --template-version option:
lein new $TEMPLATE_NAME $PROJECT_NAME --template-version $TEMPLATE_VERSION
If you use the --snapshot
or --template-version
argument with template args
you may need to use --
to prevent template args from being interpreted as
arguments to lein new
:
lein new $TEMPLATE_NAME $PROJECT_NAME --snapshot -- template-arg-1 template-arg-2
Third-party templates can be found at by searching on Clojars: https://clojars.org/search?q=artifact-id:lein-template*
Note that there's no need to "install" a given third- party template; lein will automatically fetch it for you.
Use lein new :show $TEMPLATE
to see details about a given template.
To create a new template of your own, run lein help templates
.
Generate scaffolding for a new project based on a template. If only one argument is passed to the "new" task, the default template is used and the argument is used as the name of the project. If two arguments are passed, the first should be the name of a template, and the second is used as the name of the project, for example: lein new $TEMPLATE_NAME $PROJECT_NAME To generate to a directory different than your project's name use --to-dir: lein new $TEMPLATE_NAME $PROJECT_NAME --to-dir $DIR By default, the "new" task will not write to an existing directory. Supply the --force option to override this behavior: lein new $TEMPLATE_NAME $PROJECT_NAME --force lein new $TEMPLATE_NAME $PROJECT_NAME --to-dir $DIR --force Arguments can be passed to templates by adding them after "new"'s options. Use `--` to separate arguments to lein new and the actual template you are using: lein new $TEMPLATE_NAME $PROJECT_NAME --to-dir $DIR -- template-arg-1 template-arg-2 If you'd like to use an unreleased (ie, SNAPSHOT) template, pass in --snapshot: lein new $TEMPLATE_NAME $PROJECT_NAME --snapshot If you'd rather like to use a specific version of template, specify the version with --template-version option: lein new $TEMPLATE_NAME $PROJECT_NAME --template-version $TEMPLATE_VERSION If you use the `--snapshot` or `--template-version` argument with template args you may need to use `--` to prevent template args from being interpreted as arguments to `lein new`: lein new $TEMPLATE_NAME $PROJECT_NAME --snapshot -- template-arg-1 template-arg-2 Third-party templates can be found at by searching on Clojars: https://clojars.org/search?q=artifact-id:lein-template* Note that there's no need to "install" a given third- party template; lein will automatically fetch it for you. Use `lein new :show $TEMPLATE` to see details about a given template. To create a new template of your own, run `lein help templates`.
(show name)
Show details for a given template.
Show details for a given template.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close