### Example Project Definition for Release Source: https://github.com/technomancy/leiningen/blob/main/doc/DEPLOY.md Example project definition showing a snapshot version, used in conjunction with the `lein release` task. ```clojure (defproject leiningen "2.4.0-SNAPSHOT" ...) ``` -------------------------------- ### Project Configuration Source: https://github.com/technomancy/leiningen/blob/main/web/index.html Example of a project.clj file defining project metadata, dependencies, and the main namespace. ```clojure (defproject leiningen.org "1.0.0" :description "Generate static HTML for https://leiningen.org" :dependencies \[[enlive "1.0.1"] [cheshire "4.0.0"] [org.markdownj/markdownj "0.3.0-1.0.2b4"]] :main leiningen.web) ``` -------------------------------- ### Leiningen Project Configuration Source: https://github.com/technomancy/leiningen/blob/main/README.md Example of a `project.clj` file defining project metadata, dependencies, and plugins. ```clojure (defproject myproject "0.5.0-SNAPSHOT" :description "A project for doing things." :license "Eclipse Public License 1.0" :url "https://codelab.org/technomancy/myproject" :dependencies [[org.clojure/clojure "1.8.0"]] :plugins [[lein-tar "3.2.0"]] ) ``` -------------------------------- ### Install Plugin Locally Source: https://github.com/technomancy/leiningen/blob/main/doc/PLUGINS.md Builds and installs a plugin JAR into the local Maven repository. This is typically done once before using the plugin in another project. ```bash lein install Created ~/sample-plugin/target/sample-plugin-0.1.0-SNAPSHOT.jar Wrote ~/sample-plugin/pom.xml Installed jar and pom into local repo. ``` -------------------------------- ### Basic project.clj Configuration Source: https://github.com/technomancy/leiningen/blob/main/doc/TUTORIAL.md This is a starting point for your project.clj file. Remember to fill in the description and URL, and manage your Clojure version and other dependencies. ```clojure (defproject my-stuff "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "https://example.com/FIXME" :license {:name "Eclipse Public License" :url "https://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.11.4"]] :main ^:skip-aot my-stuff.core :target-path "target/%s" :profiles {:uberjar {:aot :all}}) ``` -------------------------------- ### Install Local Leiningen Template for System-wide Testing Source: https://github.com/technomancy/leiningen/blob/main/doc/TEMPLATES.md After running `lein install` in your template project directory, you can test your template from any directory on your system. This makes it easier to test without publishing. ```bash lein install ``` -------------------------------- ### Checkout Dependencies Configuration Source: https://github.com/technomancy/leiningen/blob/main/doc/TUTORIAL.md Example of how to list checkout dependencies in a project.clj file. These dependencies take precedence over those from repositories. ```clojure :dependencies [[org.clojure/clojure "1.9.0"] ... [suchwow "0.3.9"] [com.megacorp/commons "1.3.5"] ...] ``` -------------------------------- ### Bootstrap Leiningen with Maven Source: https://github.com/technomancy/leiningen/blob/main/CONTRIBUTING.md Use Maven to install Leiningen and build its classpath. This is an alternative bootstrapping method if a stable Leiningen build is not available or desired. ```bash cd leiningen-core mvn install mvn dependency:build-classpath -Dmdep.outputFile=cp.txt ``` -------------------------------- ### Example Project Map Output Source: https://github.com/technomancy/leiningen/blob/main/lein-pprint/README.md This is a sample of the pretty-printed project map that lein-pprint generates. ```clojure { :compile-path "/home/phil/src/leiningen/lein-pprint/classes", :group "lein-pprint", :source-path ("/home/phil/src/leiningen/lein-pprint/src"), :dependencies nil, :target-path "/home/phil/src/leiningen/lein-pprint/target", :name "lein-pprint", :root "/home/phil/src/leiningen/lein-pprint", :version "1.0.0", :jar-exclusions ["^\."], :test-path ("/home/phil/src/leiningen/lein-pprint/test"), :repositories (["central" {:url "https://repo1.maven.org/maven2"}] ["clojars" {:url "https://repo.clojars.org/"}]), :uberjar-exclusions ["^META-INF/DUMMY.SF"], :eval-in :leiningen, :plugins [[lein-swank "1.4.0-SNAPSHOT"]], :resources-path ("/home/phil/src/leiningen/lein-pprint/dev-resources" "/home/phil/src/leiningen/lein-pprint/resources"), :native-path "/home/phil/src/leiningen/lein-pprint/native", :description "Pretty-print a representation of the project map."} ``` -------------------------------- ### Print Project Version Without Pretty-Printing Source: https://github.com/technomancy/leiningen/blob/main/lein-pprint/README.md Use the '--no-pretty' flag to disable pretty-printing and get raw output. This example shows how to retrieve the project version. ```bash $ lein pprint :version ``` -------------------------------- ### Configuring Project Middleware in project.clj Source: https://github.com/technomancy/leiningen/blob/main/doc/PLUGINS.md This example shows how to specify middleware functions to be applied to the project map in a `project.clj` file. Middleware can transform the project configuration, but its use should be carefully considered due to potential debugging difficulties. ```clojure :middleware [leiningen.inject/middleware] ``` -------------------------------- ### Raw Output with --no-pretty Flag Source: https://github.com/technomancy/leiningen/blob/main/lein-pprint/README.md Demonstrates using the '--no-pretty' flag with an argument to get raw output, specifically for the project version. ```bash $ lein pprint --no-pretty -- :version ``` -------------------------------- ### Include Plugin in Project Source: https://github.com/technomancy/leiningen/blob/main/doc/PLUGINS.md Lists a locally installed plugin with its version in a separate project's project.clj file. This is done after `lein install` has been run for the plugin. ```clojure ... :plugins [[sample-plugin "0.1.0-SNAPSHOT"]] ... ``` -------------------------------- ### Run Project Main Function Source: https://github.com/technomancy/leiningen/blob/main/doc/TUTORIAL.md Executes the `-main` function of your project directly from the command line without starting an interactive REPL. This is a simpler way to run your application. ```bash $ lein run ``` -------------------------------- ### Launch Interactive REPL Source: https://github.com/technomancy/leiningen/blob/main/README.md Start an interactive Read-Eval-Print Loop (REPL) session for the project with the `lein repl` command. ```bash lein repl ``` -------------------------------- ### Credentials Map for ~/.lein/credentials.clj Source: https://github.com/technomancy/leiningen/blob/main/doc/DEPLOY.md Example structure for storing credentials in ~/.lein/credentials.clj, mapping repository identifiers to authentication details. ```clojure {#"blueant" {:password "locative1"} #"https://repo.clojars.org" {:username "milgrim" :password "CLOJARS_677eb77a08974e2797bbd17a402464e5cd0f987689487633895e649b312e"} "s3p://s3-repo-bucket/releases" {:username "AKIAIN..." :passphrase "1TChrGK4s..."}} ``` -------------------------------- ### Install GPG on Fedora-based Linux Source: https://github.com/technomancy/leiningen/blob/main/doc/GPG.md Installs GPG version 1.x on Fedora-based Linux distributions using yum. ```bash yum install gnupg ``` -------------------------------- ### Install GPG on Debian-based Linux Source: https://github.com/technomancy/leiningen/blob/main/doc/GPG.md Installs GPG version 1.x on Debian-based Linux distributions if it's not already present. ```bash apt-get install gnupg ``` -------------------------------- ### Adding clj-http Dependency Source: https://github.com/technomancy/leiningen/blob/main/doc/TUTORIAL.md Example of how to add the clj-http library as a dependency in your project.clj. Leiningen will automatically download it. ```clojure :dependencies [[org.clojure/clojure "1.8.0"] [clj-http "3.13.1"]] ``` -------------------------------- ### Start Leiningen REPL Source: https://github.com/technomancy/leiningen/blob/main/doc/TUTORIAL.md Initiates a Read-Eval-Print Loop (REPL) for interactive code execution within your project context. This is useful for experimenting with code and dependencies. ```bash $ cd my-stuff $ lein repl ``` -------------------------------- ### Complete Leiningen Project Configuration for Mixed Compilation Source: https://github.com/technomancy/leiningen/blob/main/doc/MIXED_PROJECTS.md A full project.clj example demonstrating interleaved Clojure and Java compilation. It includes dependencies, plugins, source paths, and a ':precomp' profile with ':prep-tasks' for code generation and AOT compilation. ```clojure (defproject example/parser "0.0.1" :description "Parser written in Clojure, with generated Java sources" :min-lein-version "2.0.0" :dependencies [[org.clojure/clojure "1.5.0"] [net.sf.beaver/beaver-ant "0.9.9"]] :plugins [[lein-beaver "0.1.2-SNAPSHOT"]] :source-paths ["src/clojure"] :java-source-paths ["target/src"] :grammar-src-dir "src/grammar" :grammar-dest-dir "target/src" :profiles { :precomp { :prep-tasks ^:replace ["beaver" "compile"] :source-paths ["src/pre/clojure"] :aot [parser.ast] } }) ``` -------------------------------- ### Evaluate Code in Project Context with Leiningen Source: https://github.com/technomancy/leiningen/blob/main/doc/PLUGINS.md Use `eval-in-project` to execute code within a project's classpath. The `init` form can be used to require namespaces upfront. This example demonstrates launching a Swank server by merging a Swank Clojure dependency profile. ```clojure (def swank-profile {:dependencies [['swank-clojure "1.4.3"]]}) (defn swank "Launch swank server for Emacs to connect. Optionally takes PORT and HOST." [project port host & opts] (let [profile (or (:swank (:profiles project)) swank-profile) project (project/merge-profiles project [profile])] (eval-in-project project `(swank.core/-main ~@opts) '(require 'swank.core)))) ``` -------------------------------- ### Running the Application Source: https://github.com/technomancy/leiningen/blob/main/resources/leiningen/new/app/README.md This command shows how to execute the standalone JAR file for the application. Replace '{{name}}' with your application's name and '0.1.0' with the version. ```bash $ java -jar {{name}}-0.1.0-standalone.jar [args] ``` -------------------------------- ### Install GPG via MacPorts on macOS Source: https://github.com/technomancy/leiningen/blob/main/doc/GPG.md Installs GPG version 2.x on macOS using the MacPorts package manager. ```bash port install gnupg2 ``` -------------------------------- ### Install GPG via Homebrew on macOS Source: https://github.com/technomancy/leiningen/blob/main/doc/GPG.md Installs GPG version 2.x on macOS using the Homebrew package manager. ```bash brew install gnupg2 ``` -------------------------------- ### Run Project Main Function with Namespace Source: https://github.com/technomancy/leiningen/blob/main/doc/TUTORIAL.md Executes the `-main` function from a specific namespace (e.g., 'my-stuff.server') using the `-m` argument. This is useful when your main entry point is not in the default namespace. ```bash $ lein run -m my-stuff.server 5000 ``` -------------------------------- ### REPL: Perform HTTP GET Request Source: https://github.com/technomancy/leiningen/blob/main/doc/TUTORIAL.md Executes an HTTP GET request to 'https://leiningen.org' using the `clj-http` library and stores the response in a variable named 'response'. ```clojure (def response (http/get "https://leiningen.org")) ``` -------------------------------- ### Display Project Directory Structure Source: https://github.com/technomancy/leiningen/blob/main/doc/TUTORIAL.md The 'tree' command can be used to visualize the generated project's directory layout. The '-F', '-a', and '--dirsfirst' flags provide a detailed and organized view. ```bash tree -F -a --dirsfirst my-stuff/ ``` -------------------------------- ### Bootstrap Leiningen Development Dependencies Source: https://github.com/technomancy/leiningen/blob/main/CONTRIBUTING.md Navigate to the leiningen-core directory and run the bootstrap command to set up development dependencies and compile tasks. This is necessary when working on a Leiningen checkout. ```bash cd leiningen-core lein bootstrap # or lein.bat on Windows. ``` -------------------------------- ### Raw Project Version Output Source: https://github.com/technomancy/leiningen/blob/main/lein-pprint/README.md This is the raw output for the project version when '--no-pretty' is used. ```bash "1.0.0" ``` -------------------------------- ### Basic lein-pprint Usage Source: https://github.com/technomancy/leiningen/blob/main/lein-pprint/README.md Run the 'lein pprint' command in your project directory to pretty-print the project map. ```bash $ lein pprint ``` -------------------------------- ### Managed Dependencies with Classifier Source: https://github.com/technomancy/leiningen/blob/main/doc/MANAGED_DEPS.md Example of managing dependencies that include a classifier. The classifier must be specified in both managed and regular dependency sections. ```clojure (defproject superfun/happyslide "1.0.0-SNAPSHOT" :description "A Clojure project with managed dependencies" :min-lein-version "2.7.0" :managed-dependencies [[commons-math "1.2" :classifier "sources"]] :dependencies [[commons-math :classifier "sources"]]) ``` -------------------------------- ### Create a New Leiningen Project Source: https://github.com/technomancy/leiningen/blob/main/doc/TUTORIAL.md Use the 'lein new' command to generate a new project. Specify 'app' for an application project or omit it for the default library template. ```bash lein new app my-stuff ``` -------------------------------- ### Configure User-Level Deploy Repositories Source: https://github.com/technomancy/leiningen/blob/main/doc/DEPLOY.md Specify deployment-only repositories in your user profile (`~/.lein/profiles.clj`) for use across multiple local projects. This allows centralizing deployment configurations. ```clojure {:user {:deploy-repositories [["internal" "https://blueant.com/archiva/internal"]]}} ``` -------------------------------- ### REPL: Execute Project Main Function Source: https://github.com/technomancy/leiningen/blob/main/doc/TUTORIAL.md Calls the `-main` function defined in your project's core namespace. This demonstrates running your project's primary logic interactively. ```clojure (my-stuff.core/-main) ``` -------------------------------- ### Raw Project Version Output with --no-pretty Source: https://github.com/technomancy/leiningen/blob/main/lein-pprint/README.md This shows the raw output of the project version when the '--no-pretty' flag is explicitly used. ```bash 1.0.0 ``` -------------------------------- ### Override Default Release Tasks Source: https://github.com/technomancy/leiningen/blob/main/doc/DEPLOY.md Customize the release workflow by defining a custom `:release-tasks` vector in your `project.clj`. This example omits the automatic version bumping after deployment. ```clojure :release-tasks [["vcs" "assert-committed"] ["change" "version" "leiningen.release/bump-version" "release"] ["vcs" "commit"] ["vcs" "tag"] ["deploy"]] ``` -------------------------------- ### Using Aliases for Project Functions Source: https://github.com/technomancy/leiningen/blob/main/doc/PLUGINS.md Demonstrates how to use aliases to run project functions without a plugin. This method allows passing project map values and command-line arguments to the function. ```clojure :aliases {"mytest" ["run" "-m" "mylib.test/go"]} ``` ```clojure :aliases {"mytest" ["run" "-m" "mylib.test/go" :project/test-paths]} ``` -------------------------------- ### Evaluate Clojure Code via Grench Source: https://github.com/technomancy/leiningen/blob/main/web/grench.html Use grench eval to execute a Clojure expression on a connected nREPL server. This example demonstrates printing a string. ```bash $ time grench eval '(prn "Hello!")' "Hello!" real 0m0.117s user 0m0.024s sys 0m0.024s ``` -------------------------------- ### Sonatype OSS Credentials Configuration Source: https://github.com/technomancy/leiningen/blob/main/doc/DEPLOY.md Add your oss.sonatype.org credentials to ~/.lein/credentials.clj.gpg for authentication. ```clojure {\"https://oss.sonatype.org/.*\" {:username "username" :password "password"}} ``` -------------------------------- ### Add Dependency with Numeric Group/Artifact ID Source: https://github.com/technomancy/leiningen/blob/main/doc/FAQ.md Use string-based dependency names in your project.clj to include dependencies where the group ID or artifact ID starts with a number. ```clojure :dependencies [["net.3scale/3scale-api" "3.0.2"]] ``` -------------------------------- ### Define Managed Dependencies in project.clj Source: https://github.com/technomancy/leiningen/blob/main/doc/MANAGED_DEPS.md Example of specifying managed dependencies along with regular dependencies. Managed dependencies ensure specific versions are used for transitive dependencies. ```clojure (defproject superfun/happyslide "1.0.0-SNAPSHOT" :description "A Clojure project with managed dependencies" :min-lein-version "2.7.0" :managed-dependencies [[clj-time "0.12.0"] [me.raynes/fs "1.4.6"] [ring/ring-codec "1.0.1"]] :dependencies [[clj-time] [me.raynes/fs]]) ``` -------------------------------- ### Create and Use a Project-Specific Task Source: https://github.com/technomancy/leiningen/blob/main/doc/PLUGINS.md Define a custom task in `tasks/leiningen/` and add `tasks` to `.lein-classpath` to make it executable. This is suitable for experimentation or when a full plugin is not warranted. ```shell ls README.md project.clj src tasks test ls -R tasks leiningen tasks/leiningen: foo.clj echo -ne ":tasks" | cat >> .lein-classpath lein foo ``` -------------------------------- ### Repository Credentials from Environment or GPG Source: https://github.com/technomancy/leiningen/blob/main/doc/DEPLOY.md Prioritize GPG credentials and fall back to environment variables for repository authentication. ```clojure :repositories [["releases" {:url "https://blueant.com/archiva/internal" :username [:gpg :env/archiva_username] :password [:gpg :env/archiva_password]}]] ``` -------------------------------- ### REPL: Inspect HTTP Response Keys Source: https://github.com/technomancy/leiningen/blob/main/doc/TUTORIAL.md Retrieves and displays the keys (metadata) from the 'response' variable, which holds the result of the HTTP GET request. Useful for understanding the structure of the response. ```clojure (keys response) ``` -------------------------------- ### Profile Merging with Metadata Hints Source: https://github.com/technomancy/leiningen/blob/main/doc/PROFILES.md Demonstrates how to use `:replace` and `:displace` metadata to control profile merging behavior for specific keys. ```clojure {:profiles {:dev {:prep-tasks ^:replace ["clean" "compile"] :aliases ^:displace {"launch" "run"}}}} ``` -------------------------------- ### REPL: View Source of -main Function Source: https://github.com/technomancy/leiningen/blob/main/doc/TUTORIAL.md Displays the source code of the `-main` function. This is helpful for understanding the implementation details of your project's entry point. ```clojure (source -main) ``` -------------------------------- ### Defining a Leiningen Task with Subtasks Source: https://github.com/technomancy/leiningen/blob/main/doc/PLUGINS.md Example of a Leiningen task that defines subtasks. The `:subtasks` metadata lists the subtask vars, and the task body uses a `case` statement to dispatch to the appropriate subtask based on the `sub-name` argument. Arguments are passed as strings and may require `read-string` for conversion. ```clojure (defn my-task "Automatically write all the project's code." {:subtasks [#'my-subtask-0 #'my-subtask-1]} [project & [sub-name]] (case sub-name "my-subtask-0" (my-subtask-0 project args) "my-subtask-1" (my-subtask-1 project args) nil :not-implemented-yet (leiningen.core.main/warn "Unknown task."))) ``` -------------------------------- ### Configure Repository Authentication via Profile Source: https://github.com/technomancy/leiningen/blob/main/doc/DEPLOY.md Store credentials directly in ~/.lein/profiles.clj for full-disk encrypted systems, mapping URL regexes to authentication details. ```clojure {:user {...} :auth {:repository-auth {#"blueant" {:username "milgrim" :password "locative1"}}}} ``` -------------------------------- ### Enable HTTP Repositories in project.clj Source: https://github.com/technomancy/leiningen/blob/main/doc/FAQ.md Use this snippet to re-enable support for insecure HTTP repositories if you understand the security risks. This is generally not recommended. ```clojure (require 'cemerick.pomegranate.aether) (cemerick.pomegranate.aether/register-wagon-factory! "http" #(org.apache.maven.wagon.providers.http.HttpWagon.)) ``` -------------------------------- ### Configure Artifactory/Nexus/Archiva Repositories Source: https://github.com/technomancy/leiningen/blob/main/doc/DEPLOY.md Add repository URLs for snapshots and releases to your project.clj when using repository managers like Artifactory, Nexus, or Archiva. These can be specified in the general `:repositories` or specifically in `:deploy-repositories`. ```clojure :repositories [["snapshots" "https://blueant.com/archiva/snapshots"] ["releases" "https://blueant.com/archiva/internal"]] ``` -------------------------------- ### Package Project as Uberjar Source: https://github.com/technomancy/leiningen/blob/main/README.md Create a standalone executable JAR file containing the project and its dependencies using `lein uberjar`. ```bash lein uberjar ``` -------------------------------- ### Dynamic Profile Values with Eval Source: https://github.com/technomancy/leiningen/blob/main/doc/PROFILES.md Shows how to use `#=(eval ...)` syntax to dynamically set profile values by reading environment variables. ```clojure {:user {:compile-path #=(eval (System/getenv "ci.compile-path")), :target-path #=(eval (System/getenv "ci.target-path"))}} ``` -------------------------------- ### Deploy Library to Clojars Source: https://github.com/technomancy/leiningen/blob/main/doc/TUTORIAL.md Command to deploy your library to the Clojars repository. It prompts for credentials if not configured and shows the upload process. ```bash $ lein deploy clojars No credentials found for clojars See `lein help deploying` for how to configure credentials to avoid prompts. Username: me Password: Created ~/src/my-stuff/target/my-stuff-0.1.0-SNAPSHOT.jar Wrote ~/src/my-stuff/pom.xml Retrieving org/clojars/my-clojars-username/my-stuff/0.1.0-SNAPSHOT/maven-metadata.xml from https://repo.clojars.org/ Sending org/clojars/my-clojars-username/my-stuff/0.1.0-SNAPSHOT/my-stuff-0.1.0-20190525.161117-2.jar (9k) to https://repo.clojars.org/ Sending org/clojars/my-clojars-username/my-stuff/0.1.0-SNAPSHOT/my-stuff-0.1.0-20190525.161117-2.pom (2k) to https://repo.clojars.org/ Retrieving org/clojars/my-clojars-username/my-stuff/maven-metadata.xml from https://repo.clojars.org/ Sending org/clojars/my-clojars-username/my-stuff/0.1.0-SNAPSHOT/maven-metadata.xml (1k) to https://repo.clojars.org/ Sending org/clojars/my-clojars-username/my-stuff/maven-metadata.xml (1k) to https://repo.clojars.org/ ``` -------------------------------- ### User Profile Configuration Source: https://github.com/technomancy/leiningen/blob/main/doc/PROFILES.md Configure your :user profile in ~/.lein/profiles.clj to include development-time dependencies and plugins. ```clojure {:user {:plugins [[lein-pprint "1.1.1"]] :dependencies [[slamhound "1.3.1"]]}} ``` -------------------------------- ### Repository Credentials from Environment Variables Source: https://github.com/technomancy/leiningen/blob/main/doc/DEPLOY.md Configure repositories to fetch usernames and passwords from environment variables using namespaced keywords. ```clojure :repositories [["releases" {:url "https://blueant.com/archiva/internal" :username :env/archiva_username :password :env/archiva_password}]] ``` -------------------------------- ### Profile Configuration for Dependency Versions Source: https://github.com/technomancy/leiningen/blob/main/doc/PROFILES.md Shows how to define profiles to manage different versions of dependencies, specifically for Clojure itself. ```clojure (defproject swank-clojure "1.5.0-SNAPSHOT" :description "Swank server connecting Clojure to Emacs SLIME" :dependencies [[org.clojure/clojure "1.2.1"] [clj-stacktrace "0.2.4"] [cdt "1.2.6.2"]] :profiles {:1.3 {:dependencies [[org.clojure/clojure "1.3.0"]]} :1.4 {:dependencies [[org.clojure/clojure "1.4.0-beta1"]]}}) ``` -------------------------------- ### Configure Default Deploy Repositories Source: https://github.com/technomancy/leiningen/blob/main/doc/DEPLOY.md Set default repositories for deploying artifacts to Clojars. ```clojure {:deploy-repositories [["releases" :clojars] ["snapshots" :clojars]]} ``` -------------------------------- ### Compiling with the Precomp Profile Source: https://github.com/technomancy/leiningen/blob/main/doc/MIXED_PROJECTS.md Command to execute Leiningen using the ':precomp' profile to perform initial compilation steps, including code generation and AOT compilation. ```bash $ lein with-profile precomp compile ``` -------------------------------- ### Sonatype OSS Deployment Repository Configuration Source: https://github.com/technomancy/leiningen/blob/main/doc/DEPLOY.md Configure your project.clj to include the Sonatype OSS deployment repository endpoints. ```clojure :deploy-repositories [["releases" {:url "https://oss.sonatype.org/service/local/staging/deploy/maven2/" :creds :gpg} "snapshots" {:url "https://oss.sonatype.org/content/repositories/snapshots/" :creds :gpg}]] ``` -------------------------------- ### Deploy Project to Clojars Source: https://github.com/technomancy/leiningen/blob/main/README.md Publish the project to Clojars as a library using the `lein deploy clojars` command. ```bash lein deploy clojars ``` -------------------------------- ### Create a New Leiningen Template Source: https://github.com/technomancy/leiningen/blob/main/doc/TEMPLATES.md Use this command to generate the basic structure for a new Leiningen template project. The template will be named after the library it's intended for. ```bash lein new template us.technomancy/liquid-cool --to-dir liquid-cool-template ``` -------------------------------- ### Configure Global GPG Signing Key Source: https://github.com/technomancy/leiningen/blob/main/doc/GPG.md Add a global GPG signing key to your user profile in ~/.lein/profiles.clj using the key ID. ```clojure {:user ... :signing {:gpg-key "2ADFB13E"}} ``` -------------------------------- ### Add Plugin Source to Classpath Source: https://github.com/technomancy/leiningen/blob/main/doc/PLUGINS.md For local development, add the plugin's source directory to the `.lein-classpath` file in the test project. This allows for live changes without re-installing. ```bash lein help ``` -------------------------------- ### Generate New Project Skeleton Source: https://github.com/technomancy/leiningen/blob/main/README.md Use the `lein new` task to generate a new project skeleton. Specify a template and a name for the project. ```bash lein new [TEMPLATE] NAME ``` -------------------------------- ### Invoke Plugin from Command Line Source: https://github.com/technomancy/leiningen/blob/main/resources/leiningen/new/plugin/README.md Execute the plugin's functionality using this command in your terminal. ```bash $ lein {{unprefixed-name}} ``` -------------------------------- ### Add a README.md Template File Source: https://github.com/technomancy/leiningen/blob/main/doc/TEMPLATES.md This snippet shows how to add a README.md file to your template. It uses Mustache templating to insert the project name dynamically. Ensure the corresponding entry is added to the `->files` data in your template's main Clojure file. ```markdown # {{name}} This is our readme! ``` ```clojure ["README.md" (render "README.md" data)] ``` -------------------------------- ### List Public GPG Keys Source: https://github.com/technomancy/leiningen/blob/main/doc/GPG.md Lists all public keys stored in your GPG keystore. This is useful for identifying key IDs needed for other operations. ```bash gpg --list-keys ```