Skip to content

Instantly share code, notes, and snippets.

@delitescere delitescere/project.clj
Last active Jun 23, 2017

Embed
What would you like to do?
Mostly Java-based lein project with JUnit and Log4J2 (main.clj is still entry point)
(defproject com.example/foo "0.1.0"
:description "Does fooness"
:url "http://example.com/"
:license {:name "Copyright ©2014 Josh Graham"}
:aliases {"dist" ["do" ["clean"] ["test"] ["uberjar"]] ;$ lein dist # create distribution JAR
"debug" ["with-profile" "dev,debug" "run"]} ;$ lein debug # run for a 'remote' debugger
:aot :all
:auto-clean false ;"dist" alias does the full cycle
:clean-targets ^{:protect false} [:target-path :junit-results-dir]
:dependencies [
[org.clojure/clojure "1.8.0"]
[joda-time/joda-time "2.5"]
;; Logging
[org.clojure/tools.logging "0.3.1"]
[org.slf4j/slf4j-api "1.7.21"]
[org.slf4j/jcl-over-slf4j "1.7.21"]
[org.slf4j/jul-to-slf4j "1.7.21"]
[org.apache.logging.log4j/log4j-core "2.8.2"]
[org.apache.logging.log4j/log4j-slf4j-impl "2.8.2"]
[com.fasterxml.jackson.core/jackson-core "2.8.8"]
[com.fasterxml.jackson.core/jackson-databind "2.8.8"]
[com.fasterxml.jackson.dataformat/jackson-dataformat-yaml "2.8.8"]
[com.lmax/disruptor "3.3.0"]
]
:deploy-branches ["master"]
:eval-in :nrepl
:injections [(require 'clojure.pprint)]
:java-source-paths ["src" "test"]
:javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options" "-Xlint:unchecked" "-XDignore.symbol.file"] ;warn, except about proprietary API use
:junit ["test"]
:junit-formatter "xml"
:junit-results-dir "test-results"
:jvm-opts ["-DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector"]
:main foo.main
:omit-source true
:plugins [
[lein-environ "1.0.0"]
[lein-junit "1.1.8"]
[lein-pprint "1.1.2"]
]
:pom-location "target"
:profiles {:dev {:dependencies [
[junit/junit "4.11"] ;JUnit testing
[org.clojure/tools.nrepl "0.2.5"]
[org.hamcrest/hamcrest-all "1.3"]
[org.mockito/mockito-core "1.10.19"]
]}
:debug {:jvm-opts ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"]}
:uberjar {:aot :all}}
:release-tasks [
["vcs" "assert-committed"]
["change" "version" "leiningen.release/bump-version" "release"]
["vcs" "commit"]
["vcs" "tag"]
]
:repositories {"m2" "file://$HOME/.m2/repository"}
:resource-paths ["resources"]
:target-path "target"
:uberjar-exclusions [#".*/?junit" #"^clojure/test" #"^foo/.*Test"] ;Remove our testing artifacts
:uberjar-name "foo.jar"
)
@delitescere

This comment has been minimized.

Copy link
Owner Author

delitescere commented Jan 13, 2015

Directory structure looks like this:

/
  resources/
  src/
    foo/
  target/
  test/
    foo/
  test-results/
  project.clj

The src/ is a source root and test/ is a test source root. The foo/ in both are package directories (no need for long, unwieldy, FQDN-based package names in micro-services). Java and Clojure source files live in the same directories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.