Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8888367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:00:50+00:00 2026-06-14T22:00:50+00:00

If I create a new clojure project with leiningen, it makes a directory tree

  • 0

If I create a new clojure project with leiningen, it makes a directory tree like so:

.
|-- doc
|   `-- intro.md
|-- project.clj
|-- README.md
|-- src
|   `-- hello_friend
|       `-- core.clj
`-- test
    `-- hello_friend
        `-- core_test.clj

Often, all I want is a single clojure file, and I want to use leiningen to handle libraries and start a repl.

I’ve got two questions:

(1) Is is possible to get leiningen to work properly with this structure

.
|-- project.clj
`-- hello.clj

which I’d greatly prefer. (In fact even better would be to have the project.clj as part of the hello.clj file)

(2) Is there any good reason for the deep directory structure? Or is it just a habit from java-land?


Note, this works fine as far as I can see:

project.clj

(defproject generic "0.0.0"
  :dependencies 
  [[org.clojure/clojure "1.4.0"]
   [hiccup "1.0.2"]]
  :source-paths ["."]
  :main two

  :repl-options { :port 4001 :init (println "(-main) to run") }
)

one.clj

(ns one
  (:use hiccup.core))

(def doom (html [:h1 "doom"]))

two.clj

(ns two 
  (:require one))

(defn -main [] 
  (println one/doom))
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:00:52+00:00Added an answer on June 14, 2026 at 10:00 pm

    (1) You can specify :source-paths ["."] in your project.clj. See lein sample project for all possible options

    (2) You need the "deep" structure once you have 2 namespaces and one requires on the other. See here for an explanation of how namespaces are mapped to files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When you create a Clojure project with leiningen all the *.clj-files are compiled AOT.
I can't create New Project on my Visual Web Developer 2008 Express with SP1.
I'm trying to create a new type in Clojure using deftype to implement a
As I've understood, when you create a new list with expression like the following,
I have project created with Leiningen and following code in Core.clj file: (ns hyperstring.core
I'm new in clojure, i try create functions thats will be sort collections and
I'm new to Clojure and I was wondering if there's a way to create
I create new desktop with CreateDesktop and want to get it's DC & RC.
I create new blank solution. Add exist web site. Structure: Solution E:...\projectname Folders: bin
Code to create new form instance of a closed form using form name I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.