Fork me on GitHub
#clojure
<
2019-11-05
>
josh_tackett00:11:19

What is the difference in what compiles between lein ring server-headless vs lein run? In lein run I am able to slurp in strings of code, read them, and evaluate them, with lein ring server I cannot. Why is that?

hiredman00:11:17

there are lots, my guess is you are depending on ns having a particular value at runtime, which you can't

josh_tackett00:11:38

@hiredman got it, how can I fix that? I have this working with the same code snippet being slurped in and evaled when I start the code with lein run, but I need to offer an API that can run these snippets that get slurped in. This only effects deps that are outside clojure core. Can I force the jetty server to include all deps to be available to read-string -> evals at runtime?

josh_tackett00:11:14

Packaged the question a bit better here: I am running a system that slurps in string code snippets from a db, reads them, and evaluates them. When I do this with a main method via lein run I am able to use all dependencies. But when I run a jetty server, and try to slurp in the string code snippets from a db, read them, and evaluate them I get this error saying I don't have access to the dependency the string code snippet needs:

{:type clojure.lang.Compiler$CompilerException
   :message "java.lang.RuntimeException: No such namespace: http, compiling:(NO_SOURCE_PATH:0:0)"
   :at [clojure.lang.Compiler analyze "Compiler.java" 6688]}
Is there a way to force jetty to load all deps and make them available at run time to string code snippets that are slurped in at run time as strings and evaluated?

hiredman00:11:13

it isn't a deps loading issue

hiredman00:11:52

there are 16k people in this channel, maybe go easy on pinning your questions

josh_tackett00:11:22

figured the pin was just for me

hiredman00:11:28

you are loading code and expecting it to be evaluated in a particular context

josh_tackett00:11:01

yes, and that precise thing is working today. But when I introduce a jetty server it stops working

hiredman00:11:08

you are expecting to be evaluated with *ns* bound to whatever namespace is at the top of the file, which has a particular set of aliases

hiredman00:11:40

which is not true, it happens to happen for code loaded via lein, but is not true in the general case

hiredman00:11:31

when your code runs, *ns* could have any arbitrary value, so when you load and evaluate some other code, if it does set *ns* itself, you could get anything

hiredman00:11:23

(`*ns*` is the binding that points to the current namespace which is used to resolve aliases and what not by the compiler)

hiredman00:11:18

a very typical value for *ns* to have at runtime when running from a jar is clojure.core

josh_tackett00:11:46

so maybe something like this:

(defn local-eval [x]
 (binding [*ns* (find-ns 'my-namespace)]
   (eval x)))

josh_tackett00:11:13

what's strange is the code snippet I'm trying to run is being evaled in the correct ns...or at least I think it is

hiredman00:11:25

or just, I dunno, write your snippets as nice little namespaces

hiredman00:11:46

you should print out *ns* before you eval

josh_tackett00:11:40

let me see what I get real quick

hiredman00:11:01

but like, if you write your code with an ns declaration at the top, you can load it an compile it in almost any context

josh_tackett00:11:52

"NS: " #object[clojure.lang.Namespace 0x1896a6c "clojure.core"]

josh_tackett00:11:55

yep clojure core

josh_tackett00:11:59

so that's not what I want haha

hiredman00:11:04

and it will make it much easier for someone to come along later, decide they don't like the snippet thing, an replace it with the standard require call

josh_tackett00:11:22

you mean declare the ns in the snippet?

josh_tackett00:11:49

just (def *ns* (find-ns 'my-namespace)) like that?

hiredman00:11:05

(ns whatever.mysnippet1
         :require something)

dowhatever
`

hiredman00:11:19

no, I mean, in the text file that you are loading and evaluating, give it the same kind of ns form you are presumably putting at the top of all your other source files

josh_tackett01:11:18

I got it working now with the local-eval thing

josh_tackett01:11:22

thank you for your help

josh_tackett01:11:34

I'll need to consider if we update the 100+ scripts with their own ns also

Daniel Stephens10:11:28

Any suggestions on who is good to follow on 4clojure? A Colleague suggested Christopher Grand (cgrand) but while I've found a few of his solutions online (https://github.com/nbenketaf/4clojure/blob/master/problem105.clj) I can't find his user on 4clojure 😮

Daniel Stephens10:11:57

@U3E46Q1DG 😊 Just in case, am I just not searching by the correct thing or do your solutions live somewhere I've overlooked?

Daniel Stephens10:11:40

Oh, my bad, the user search isn't great, navigating directly to the url worked http://www.4clojure.com/user/cgrand

Mattias10:11:24

Hey, I didn’t realize you can view others users solutions on 4clojure. The help page doesn’t mention it. How does that happen? 🙂

Daniel Stephens10:11:24

When you complete a solution yourself you can see answers of users that you follow

cgrand10:11:41

4clojure, it has been a long time — not sure I would still solve problems in the same way; plus there’s the golf aspect that makes some answers not “production ready”

👍 4
Daniel Stephens10:11:29

No problem, thanks! Still learning a lot from it regardless, (apply map list b) just blew my mind on your 111. Crossword puzzle 😂

Daniel Stephens10:11:54

my version of getting columns was about 3 lines and less readable

cgrand11:11:04

@ULNRSUK8C in real world I would certainly write something more like

(fn [word cw]
  (->>
    (for [line (concat cw (apply map str cw))
    	  slot (.split line "#")
          :when (seq slot)] ; not necessary to pass 4clojure tests
      (apply str (keep #({\_ \. \space nil} % %) slot)))
    (some #(re-matches (re-pattern %) word))
    boolean))

👍 4
Daniel Stephens12:11:37

My initial solution wasn't terrible (maybe) 😬 but just interesting to see what other ways exist. I wasn't trying to golf it, I'm not there yet 😂

(fn [word board]
   (let [width (-> board
                   first
                   count
                   inc
                   (/ 2))
         get-col (fn [i] (apply str (map #(nth % i) board)))
         cols (map #(get-col (* 2 %)) (range width))]
     (-> (concat board cols)
         ((partial clojure.string/join "|"))
         (clojure.string/replace #" " "")
         (clojure.string/replace #"#" "|")
         (clojure.string/replace #"_" ".")
         (re-pattern)
         (re-matches word)
         string?)))

cgrand12:11:46

(clojure.string/replace #"[ #_]" {" " "" "|" "#" "_" "-"}) can replace your 3 calls

👍 4
cgrand12:11:18

I’m not a fan of (( but it’s purely personal

Daniel Stephens13:11:51

Didn't think about the function version of regex, thanks for the help today!

(fn [word board]
  (let [cols (apply map str board)]
    (-> (concat board cols)
        ((partial clojure.string/join "|"))
        (clojure.string/replace #"[ #_]" {" " ""
                                          "#" "|"
                                          "_" "."})
        (re-pattern)
        (re-matches word)
        boolean)))

Santiago10:11:34

I'm not familiar with Java and I would like to know how to deploy an H2O model (POJO/MOJO) http://docs.h2o.ai/h2o/latest-stable/h2o-docs/productionizing.html using Clojure. Has anyone done this before, or know who could give me some hints? 😄

mping10:11:58

clojure has good java integration

mping10:11:06

you can use genclass to generate java POJOs https://clojuredocs.org/clojure.core/gen-class

Santiago10:11:59

isn't that using clojure to generate POJOs? what if I already have a POJO and want to load it in Clojure?

mping10:11:59

here's an example of using genclas on a namespace: https://gist.github.com/mping/1e784c1c81108dd61d301863a06b3e28

didibus12:11:59

Seems like you should be able too no problem

didibus12:11:32

I think you just add the h20-genmodel.jar to your classpath

didibus12:11:05

And then you import the model and call the necessary methods using interop

deas14:11:40

Does tools.deps.alpha actually play with jdk > 8 these days?

Alex Miller (Clojure team)14:11:33

what are you concerned about?

deas14:11:22

@alexmiller Heard somebody mention that pomegranate does not play with java > 8. Guessed tools.deps.alpha may have similar issues loading deps at runtime.

Alex Miller (Clojure team)14:11:54

Those issues with pomegranate have to do with dynamic dep loading and the changes in classloader structure in Java 9+

Alex Miller (Clojure team)14:11:15

tools.deps does not currently have dynamic classloading facilities in the main line

Alex Miller (Clojure team)14:11:00

there is an add-lib branch of tools.deps with some speculative code in this area but it does not have the same issues

👍 4
deas14:11:17

@alexmiller Is Java 9+ missing a critical bit, or how come tools.alpha and pomegranate appear to be struggeling to get dynamic dep loading implemented?

Alex Miller (Clojure team)14:11:13

tools.deps doesn't have an issue with this

Alex Miller (Clojure team)15:11:33

iirc, pomegranate relies on dynapath, which can use a clojure DynamicClassLoader if it finds it but if not, also has some code to invoke protected methods on the URLClassLoader class. In Java 9+, this violates accessibility constraints.

Alex Miller (Clojure team)15:11:07

that is, dynapath does some dirty stuff, and it's more tightly checked as of Java 9

👍 4
borkdude16:11:39

I'm trying to add support for compojure route macros to clj-kondo and I'm wondering if the destructuring syntax can be combined with POST as well. probably yes, but I don't see any example of this in its codebase

borkdude16:11:50

(same for PATCH, PUT, etc)

seancorfield16:11:49

@borkdude I would expect the destructuring to be orthogonal to the verbs since everything goes through a single request function behind the scenes.

borkdude17:11:46

looks like it yes, thanks

roninhacker17:11:57

newb question: trying to get a preload for my repl working, but seemingly having classpath issues:

profiles.clj:

     {:user {:dependencies [[cider/piggieback "0.4.2"]
                       [org.clojure/tools.nrepl "0.2.13"]]
        :source-paths ["/home/daniel/.lein/preload/"]
        :repl-options {:init-ns user}}}


cat /home/daniel/.lein/preload/user.clj:

    (ns user)

    (def data 23)
    (println "that's podracing!")

lein repl

    #error {
     :cause Could not locate user__init.class, user.clj or user.cljc on classpath.
     :via
     [{:type java.io.FileNotFoundException
       :message Could not locate user__init.class, user.clj or user.cljc on classpath.

user=> (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader)))
(#object[java.net.URL 0x6b5df995 "file:/home/daniel/.lein/self-installs/leiningen-2.9.1-standalone.jar"])

dharrigan17:11:59

try wrapping your post with three back ticks

dharrigan17:11:12

will make it easier to read 🙂

dpsutton17:11:53

first shot is drop tools.nrepl from your deps

roninhacker17:11:54

well, no idea about the classpath issue, but :init (load-file $path) seems to be working. Thanks all.

Saurabh Jain20:11:32

I am facing issue while installing clojure inside the docker..any pointers please. I am trying to install it with Java 11

bfabry20:11:04

What's the issue?

Saurabh Jain21:11:31

I am working on tap-mssql for pipelinewise that is written in clojure language. To create an image of my pipelinewise doker I need to install clojure as well that requires leiningen (RUN curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > lein && mv lein /usr/local/bin/lein && chmod a+x /usr/local/bin/lein). when it installs clojure it is giving this error java.io.IOException: Cannot run program "/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java" (in directory "/pipelinewise/.virtualenvs/tap-mssql"): error=2, No such file or directory at java.lang.ProcessBuilder.start (ProcessBuilder.java:1128) java.lang.ProcessBuilder.start (ProcessBuilder.java:1071) java.lang.Runtime.exec (Runtime.java:591) jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2) jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke (Method.java:566) clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:167) clojure.lang.Reflector.invokeInstanceMethod (Reflector.java:102) leiningen.core.eval$sh.invokeStatic (eval.clj:179) leiningen.core.eval$sh.doInvoke (eval.clj:173) clojure.lang.RestFn.applyTo (RestFn.java:137)

Saurabh Jain21:11:13

I have version JAVA 11 installed but is it checking for 8..

bfabry21:11:38

try setting JAVA_HOME environment variable to the location of the jdk you want to use

bfabry21:11:05

or JAVA_CMD as someone else said

Saurabh Jain21:11:06

I tried setting up /usr/lib/jvm/java-11-openjdk-amd64 in JAVA_HOME variable but still it is looking for 8

noisesmith22:11:04

taking a closer look at this stack trace - clojure is already running at this point, and it is using leiningen.eval/sh to invoke a new lein process (with a new java process)

noisesmith22:11:52

it looks like the tap-mssql command is doing something weird (based on the other screenshot you shared)

noisesmith22:11:18

this project is defined in a weird way, this isn't a lein problem, it's a problem with the way this tap-mssql project is set up https://github.com/singer-io/tap-mssql/blob/9895f93fb960a73432b9e7a2b7622fe6ec14f227/project.clj#L31

noisesmith22:11:28

you could fork it and ovverride its java versions?

noisesmith22:11:38

or use a different project

paul a21:11:01

what's the best way to programmatically install a particular version of clojure? per https://clojure.org/guides/getting_started#_installation_on_linux i was hoping that i might be able to use to install clojure 1.10.1, but that doesn't seem to work.

bfabry21:11:58

you want a specific version of the clojure command line utilities?

bfabry21:11:16

or you actually don't care about the version of the command line utilities and you want a specific version of the language?

paul a21:11:32

the latter, a specific version of the language.

bfabry21:11:12

clojure the language is just a dependency of your project

bfabry21:11:27

so you just specify the version you want in either your deps.edn or project.clj whatever you're using to manage dependencies

bfabry21:11:43

it'll get downloaded from maven as part of your build process

paul a21:11:57

yup - my memory started in that direction as soon as you pointed out the difference between the CLI and language.

paul a21:11:19

thanks for the quick and clear reply 🙂

bfabry21:11:27

no worries

eraserhd22:11:34

haha, I just wanna say, today I got a stack trace that wasn't verbose enough (a StackOverflowError with only 1,033 frames).

dpsutton22:11:48

(∞ frames omitted ...)

eraserhd22:11:00

it actually doesn't say that

eraserhd22:11:07

but clearly, the thread entry point wasn't clojure.lang.LazySeq.seq

noisesmith22:11:10

a lazy seq is a delayed execution, when you force it that will be the top of the stack

noisesmith22:11:20

(under the thing that forced it of course)

kwladyka22:11:37

@seancorfield hi, I found your example https://github.com/seancorfield/dot-clojure

:jar -- pulls in and runs the latest stable release of my fork of depstar to create a "thin" JAR; clj -A:jar MyProject.jar; along with a pom.xml (created via clj -Spom), this can be deployed to Clojars etc (via mvn deploy:deploy-file ...)
How exactly do you set
<groupId>master</groupId>
  <artifactId>master</artifactId>
  <version>0.1.0</version>
  <name>master</name>
in pom.xml to deploy to Clojars?

seancorfield22:11:00

With my editor 🙂

😂 4
kwladyka22:11:16

oh that is what I was afraid of 🙂

kwladyka22:11:33

I wanted to make continous deployments

seancorfield22:11:07

The pom.xml generated by clojure -Spom is very minimal and needs a lot of stuff added to it in order to deploy to Clojars and/or cljdoc.

kwladyka22:11:10

still can achieve it with bash commands to replace strings probably

Alex Miller (Clojure team)22:11:40

But -Spom will sync and leave that stuff in it once you do add it

👍 4
kwladyka22:11:44

hmm something more, than groupId, artifactId, version, name ?

seancorfield22:11:57

I have a deploy script that modifies the <tag> element to be the SHA of the git head.

vlaaad22:11:14

I extracted this from tools-deps to update version from command line, like that: clj -A:build -m version 1.0.0

seancorfield22:11:41

@alexmiller Yeah, I just meant the initial pom.xml file isn't sufficient -- it needs editing/augmenting.

vlaaad22:11:38

it probably can be generalized to be standalone library, but you can just copy-paste it and change lines 33-34 for your needs

seancorfield22:11:45

FWIW, I stopped using clojure.data.xml etc to deal with pom.xml in depstar because of Java 9+ issues. I just changed it to regex instead 🙂

vlaaad22:11:39

I use it with java 11

vlaaad22:11:47

no issues so far

seancorfield22:11:06

Don't you get warnings about illegal reflective access or something?

vlaaad22:11:16

there were issues with extra whitespace, but they were fixed both in tools-deps and in that script (`:skip-whitespace` arg)

vlaaad22:11:38

no warnings...

seancorfield22:11:43

Oh, it was clojure.xml, not clojure.data.xml.

seancorfield22:11:04

Because depstar cannot have any dependencies beyond itself and Clojure.

seancorfield22:11:23

(and Java 🙂 )

kwladyka22:11:31

Do you have a public example for continous deployment to clojars with deps.edn? The best for ClojureScript 😉

vlaaad22:11:40

ah, to not include them in generated jar?

seancorfield22:11:43

I don't do any cljs.

seancorfield22:11:26

@U47G49KHQ Right, depstar knows it can just exclude itself and use whatever is on the classpath for the JAR file. A deliberate design choice that says "Trust the user" 🙂

kwladyka22:11:28

so clj, it should be simple after what your wrote me, but who knows 🙂

seancorfield22:11:56

@U0WL6FA77 If you're doing CD, you're generating new versions as part of your CD script? Can you just modify that to read <version>XXX</version from the front of the pom.xml file, calculate a new version, and update the file?

vlaaad22:11:24

There are uberdeps that compute classpath for jar using tools-deps, so they can use other libs

seancorfield22:11:38

Here's my cheating way to do some of it in bash

sha=`git rev-parse HEAD`
version=`fgrep '<version>' pom.xml | head -1 | sed 's;.*<version>\(.*\)</version>.*;\1;'`
echo "Setting tag to ${sha} for version ${version}..."
cp pom.xml /tmp/${1}.pom.xml
sed "s;<tag>[0-9a-f]*</tag>;<tag>${sha}</tag>;" < /tmp/${1}.pom.xml > pom.xml
🙂

kwladyka22:11:38

I want to use github actions and make version from tag version of the github release

vlaaad22:11:43

I wonder why I use depstar... I guess it's good enough 😄

seancorfield22:11:23

depstar relies on the classpath computed by the CLI / t.d.a. 🙂

kwladyka22:11:59

Can I push to clojars and remove it after that? To test CD. Or it has to stay there after deploy?

seancorfield22:11:39

http://Clojars.org is immutable. You can only add to it.

seancorfield22:11:03

(except in catastrophic release situations -- such as removing a security risk)

vlaaad22:11:22

I use different group/artifact for testing deployment

seancorfield22:11:28

That still leaves cruft up on Clojars tho', right?

vlaaad22:11:31

If artifact was pushed to clojars and no one knows about it, did it really make sound

👀 4
kwladyka22:11:36

hmm It can be a stupid question, but how to add groups to my groups in clojars?

seancorfield22:11:56

org.clojars.<yourusername> should always be available if you wanted to use that for testing / unofficial releases.

kwladyka22:11:26

this one I have in my groups, but how can I make other group?

vlaaad22:11:23

You release an artifact

vlaaad22:11:44

It will create a group and will make it yours

kwladyka22:11:11

oh so it will make it mine, unless somebody else already created it

seancorfield22:11:16

I'd strongly discourage creating random extra group IDs on http://clojars.org -- that's antisocial.

kwladyka22:11:29

So do you suggest to use org.clojars.kwladyka and only this one for all my work?

seancorfield22:11:33

You can test pushing to org.clojars.kwladyka/test-lib without cluttering up http://clojars.org (if that's your username).

seancorfield22:11:23

When you have a lib that you want publicly available, maybe pick a different/better group ID (such as kwladyka if you think that'll be unique enough).

seancorfield22:11:01

I have org.clojars.seancorfield but I have only used that for pushing early test versions of libs I think. I publish publicly under the seancorfield group ID.

seancorfield22:11:26

Yeah

Projects
org.clojars.seancorfield/clj-soap
org.clojars.seancorfield/congomongo

seancorfield22:11:41

Those aren't "real" versions for the public.

kwladyka22:11:28

> I’d strongly discourage creating random extra group IDs on http://clojars.org -- that’s antisocial. Oh ok, I understood it in a different way.

kwladyka22:11:11

thank you all for help

kwladyka22:11:23

I wish clojars has better doc

Alex Miller (Clojure team)23:11:05

If you want to test your lib you can always just install to your local repo and not push at all

kwladyka23:11:52

I want to test continuous deployment on the first place. I will use org.clojars.kwladyka for tests purpose. Sounds reasonable.

seancorfield17:11:19

Pretty much no one does that any more. Clojars used to have a two-tier system where only signed JARs could be promoted to the "top tier" but it caused confusion -- and the whole signing process, dealing with GPG, seemed to be problematic for a lot of people, especially on Windows.

seancorfield17:11:20

If you use deps-deploy and signing works for you out of the box, there's certainly no harm in signing your JARs.

kwladyka17:11:24

Hmm is it possible to sign it without upload private certificate for deps-deploy use?

kwladyka17:11:38

maybe signing mean something else here, than I think

seancorfield17:11:37

I've no idea. I stopped signing JARs years ago.

seancorfield17:11:50

Like I said, if you are using deps-deploy (which I do not), and that signing option works out of the box without you needing to do anything else, then go for it. Otherwise, be like the vast majority of people pushing JARs to Clojars and don't bother 🙂

👍 4
kwladyka17:11:49

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" xmlns:xsi="" xsi:schemaLocation=" 
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.clojars.kwladyka</groupId>
  <artifactId>form-validator-cljs</artifactId>
  <version/>
  <name>form-validator-cljs</name>
  <url>https://github.com/kwladyka/form-validator-cljs</url>
  <description>ClojureScript library to validate forms.</description>
  <developers>
    <developer>
      <name>Krzysztof Władyka</name>
    </developer>
  </developers>
</project>
Do you recommend to add something more to pom.xml?

seancorfield17:11:41

Yes, lots more.

seancorfield17:11:04

That minimal POM won't tell Clojars (or cljdoc) anything useful.

kwladyka17:11:42

I mean of course I will update it by clojure -Spom

seancorfield17:11:11

You need the scm section so that Clojars can tie the JAR back to your GitHub repo and SHA version (or a tag). The other stuff I believe is "nice to have" (`licenses`, description, url, repositories, distributionManagement).

seancorfield17:11:36

clojure -Spom produces a minimal pom.xml with a lot of useful stuff missing.

seancorfield17:11:06

Once you've added that stuff to pom.xml, clojure -Spom will not overwrite it -- it will just update the dependencies section.

seancorfield17:11:50

But I make sure all my POM files have all of that information in them, so that Clojars and cljdoc and provide extra information and links to the source repo etc.

kwladyka17:11:59

hmm clj -Spom add <sourceDirectory>src</sourceDirectory> in project but your files contain it in <build><sourceDirectory>src</sourceDirectory></build>. Is it a bug?

kwladyka17:11:14

Everywhere I see it in build

seancorfield18:11:25

@alexmiller mentioned something about when it decides to insert sourceDirectory but I don't remember the details.

seancorfield18:11:31

These days I tend to copy a pom.xml file from a project that I know "works", edit everything outside dependencies to match the new project, and then run clojure -Spom to just update it. I don't tend to start from a clojure-generated POM.

kwladyka18:11:26

Sorry, I am doing this my first time 🙂

kwladyka18:11:13

Deploying org.clojars.***/form-validator-cljs-test-0.0.1 to clojars as ***
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See  for further details.
Execution error (AuthorizationException) at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon/put (AbstractHttpClientWagon.java:625).
Access denied to: , ReasonPhrase: Forbidden - invalid pom file: Unrecognised tag: 'sourceDirectory' (position: START_TAG seen ...</dependencies>\n  <sourceDirectory>... @53:20).
Hmm it looks like sourceDirectory doesn’t work

kwladyka18:11:33

So clj -Spom making a bug in pom.xml

kwladyka18:11:12

Can I do something about that? It looks like a bug in clj -Spom command unless I miss something

kwladyka18:11:16

@alexmiller Did you see this bug before? Do you know why clojure -Spom generate sourceDirectory in project instead of project.build.sourceDirectory?

kwladyka18:11:25

hmm I found if I prepare:

<build>
    <sourceDirectory>src</sourceDirectory>
  </build>
before clj -Spom it doesn’t create project.sourceDirectory then.

seancorfield18:11:07

This is the thread between @U0666UM3J and @alexmiller about sourceDirectory from October 28th: https://clojurians.slack.com/archives/C03S1KBA2/p1572324457047300

seancorfield22:11:07

The pom.xml generated by clojure -Spom is very minimal and needs a lot of stuff added to it in order to deploy to Clojars and/or cljdoc.