clojars

Shantanu Kumar 2026-02-18T14:39:57.725389Z

Hi, can anyone tell me why won't the Git/SCM repo link appear on (top left of) this Clojars page? https://clojars.org/io.github.plumce/plumcp.core My project.clj already has :url entry pointing to Github repo.

Shantanu Kumar 2026-02-18T14:40:36.427479Z

Do I need to add :scm entry in my project.clj?

seancorfield 2026-02-18T14:46:44.659429Z

Yes, you need SCM information. It's why cljdoc isn't building as well https://cljdoc.org/builds/99347

seancorfield 2026-02-18T14:47:51.529429Z

(that should also solve the Clojars git link issue)

2026-02-18T14:50:45.590439Z

Yes indeed, thanks @seancorfield!

Shantanu Kumar 2026-02-18T14:51:50.367239Z

Thank you, @seancorfield 🙏🏽

Shantanu Kumar 2026-02-18T14:53:38.015289Z

The cljdoc URL above mentions bidi, but I don't find any SCM info in bidi's project.clj: https://github.com/juxt/bidi - is the SCM info to be added to pom.xml after it is generated from project.clj?

lread 2026-02-18T14:53:44.357019Z

Cljdoc's library author's gude on this: https://github.com/cljdoc/cljdoc/blob/master/doc/userguide/for-library-authors.adoc#git-sources

lread 2026-02-18T14:54:39.002239Z

Oops, Sean already posted, sorry Sean, not enough coffee yet!

Shantanu Kumar 2026-02-18T14:57:27.636799Z

I can see one can put :scm in project.clj, but I would like to avoid hard coding the tag: https://gitlab.com/technomancy/leiningen/blob/master/sample.project.clj#L492-498

seancorfield 2026-02-18T14:58:26.987569Z

I would have expected lein to build that for you based on project.clj -- how are you building your JAR for Clojars?

Shantanu Kumar 2026-02-18T15:00:10.796679Z

lein jar builds the JAR, and it's called transitively when I lein deploy clojars

seancorfield 2026-02-18T15:03:25.775359Z

Sorry, it's been years since I used Leiningen... If you add :scm stuff without the tag, does it populate that in pom.xml (in the JAR)?

seancorfield 2026-02-18T15:03:58.903799Z

Ah, just below what I linked to:

:scm {:name "git" :url ""}

seancorfield 2026-02-18T15:04:15.574799Z

So it only needs :name and :url and Leiningen will do the rest.

lread 2026-02-18T15:04:35.350629Z

I'm lein rusty too. I just did a lein jar on bidi, and it does populate scm in pom.xml

lread 2026-02-18T15:06:16.683369Z

Maybe the :url is enough in project.clj.

Shantanu Kumar 2026-02-18T15:06:34.109449Z

I added :scm {:name "git" :url "..."} and ran lein pom - I got this in the generated pom.xml:

<scm>
    <url></url>
  </scm>

Shantanu Kumar 2026-02-18T15:07:38.101669Z

It doesn't auto-add any other entry.

lread 2026-02-18T15:08:33.075119Z

Is your project git initialized? I think lein will git add the sha to scm entry.

Shantanu Kumar 2026-02-18T15:08:35.429489Z

@lee My project.clj has :url specified, but lein skips the <scm> entry.

Shantanu Kumar 2026-02-18T15:09:39.302889Z

Yes, my repo is on Github already (and locally too, of course)

Shantanu Kumar 2026-02-18T15:10:16.617649Z

I am on lein 2.12.0 btw

lread 2026-02-18T15:14:08.127249Z

Hmm... to me lein does some things a bit magically. And I don't remember the magic. Bidi seems to generate the pom scm appropriately. I wonder what is different.

Shantanu Kumar 2026-02-18T15:20:19.037079Z

I added :name, :url, :connection and :developerConnection under :scm in project.clj - those all end up in pom.xml as expected.

lread 2026-02-18T15:21:21.339339Z

I think pom scm gets filled magically from top level project.clj :url and your git remote?

seancorfield 2026-02-18T15:22:50.587019Z

I ran lein new clojars/example to get a default library project, and lein jar produces a pom.xml with <scm /> in it -- when I added that :scm fragment above and regenerated the JAR, I got <scm> containing <url> but no tag/version info. Then I git init'd the repo, git add . and git commit -m "init" and now when I run lein jar, I get <tag> in the <scm> section in pom.xml.

seancorfield 2026-02-18T15:23:38.257819Z

So you only get <tag> if you're in a git repo with at least one committed change (which is expected I guess).

lread 2026-02-18T15:25:48.584959Z

Yep, just tested too. Before adding a remote did not fully populate pom scm. Here's my project.clj

(defproject foobar "1.2.3"
  :description "foo"
  :url ""

  :license {:name "The MIT License"
            :url ""})
Here's the resulting pom.xml scm section after lein jar:
<scm>
    <url></url>
    <connection>scm:git:</connection>
    <developerConnection>scm:git:</developerConnection>
    <tag>e8d0fb5c431f80336f7f482611ab49ec85ff64a8</tag>
  </scm>

Shantanu Kumar 2026-02-18T15:26:59.389809Z

I am guessing there's something messing up the scm generation in this particular project - in my other projects <scm> has been generated fine automatically. I need to troubleshoot.

lread 2026-02-18T15:28:01.614199Z

For my little test project:

$ git remote -v 
origin	git@github.com:lread/lein-scm.git (fetch)
origin	git@github.com:lread/lein-scm.git (push)

Shantanu Kumar 2026-02-18T15:29:11.308309Z

I got a similar ^ response for git remote -v

lread 2026-02-18T15:30:37.992529Z

And you've pushed your commits, I assume.

Shantanu Kumar 2026-02-18T15:30:56.358289Z

Yes! Pushed everything.

lread 2026-02-18T15:31:52.610629Z

I'll take a peek at your GitHub project... see what I can see.

Shantanu Kumar 2026-02-18T15:33:20.280139Z

@lee Sure, the module path in my repo is here: https://github.com/plumce/plumcp/tree/main/module-core - Just copy project-release.clj as project.clj locally and edit the file to have a proper version. Then run the lein commands.

seancorfield 2026-02-18T15:34:04.522459Z

Ah, I wonder if it's because it's a module in a repo, and not the top-level of the repo?

lread 2026-02-18T15:34:17.243939Z

Probably

Shantanu Kumar 2026-02-18T15:35:14.873209Z

Even Ring is multi-module: https://github.com/ring-clojure/ring but it has proper SCM generated, which shows up on Clojars.

Shantanu Kumar 2026-02-18T15:36:21.372769Z

Ah, all of the Ring modules have this entry in project.clj: :scm {:dir ".."}

Shantanu Kumar 2026-02-18T15:36:25.728019Z

Maybe that's trick!

lread 2026-02-18T15:36:32.108869Z

Yes, but it has a root project.clj and sub projects

lread 2026-02-18T15:37:00.199089Z

Oh you probably found it, there!

Shantanu Kumar 2026-02-18T15:38:11.028039Z

Probably I need to create a similar setup like Ring (top level project.clj) to auto-resolve SCM. I will experiment and find out.

lread 2026-02-18T15:39:35.473459Z

If I add {:dir ".."} to your core project.clj, it works:

<scm>
    <url></url>
    <connection>scm:git:</connection>
    <developerConnection>scm:git:</developerConnection>
    <tag>955224a9e15c29371be9cf66093e0cba9033cbac</tag>
  </scm>

Shantanu Kumar 2026-02-18T15:40:07.428209Z

Yes, just adding that bit is enough - I saw that too. Thank you!

Shantanu Kumar 2026-02-18T15:41:06.911209Z

Thank you everyone for sharing pointers, ideas and debugging! 🙏🏽

lread 2026-02-18T15:42:18.099549Z

I'll add a couple of tips to the cljdoc library author docs on how lein works (if only to help future me remember!).

💙 1
lread 2026-02-18T15:44:59.734609Z

Ah... lein sample project.clj does cover this pretty well: https://codeberg.org/leiningen/leiningen/src/commit/40227328d4a9c8945362d6d626d19c2449175df6/sample.project.clj#L509-L518

lread 2026-02-18T15:46:01.990619Z

I think I was wrong above, I don't think lein will use the top level :url for the pom scm info.

Shantanu Kumar 2026-02-18T15:47:27.107169Z

I could have done better with patient reading of the sample project.clj - yes, the ^ comment explains it well.

lread 2026-02-18T15:49:19.421729Z

Hey, I was as confused as you (maybe even more so!).

lread 2026-02-18T15:50:46.294269Z

I'm now remembering that the sample project.clj is the main way leiningen delivers its docs...

➕ 1
lread 2026-02-18T15:56:35.049919Z

Oh son of a gun, I had already documented this under https://github.com/cljdoc/cljdoc/blob/master/doc/userguide/for-library-authors.adoc#git-sources Here are some common ways folks set <scm> values: • ... • https://leiningen.org/ will automatically create the <scm> entry for you if you set the :scmhttps://github.com/technomancy/leiningen/blob/bd3ecfcfb20ef7a79912879ff892e0f2317e8691/sample.project.clj#L490`project.clj`. For example: :scm {:name "git" :url "https://github.com/your-github-org/your-project"} So much for RTFMing my own M!

😅 1
seancorfield 2026-02-18T16:25:08.103029Z

That's where I linked to above and quoted that fragment 😄

❤️ 1
lread 2026-02-18T16:43:30.167289Z

And I linked to it too! I'm not doing my last name justice at all! simple_smile

lread 2026-02-18T16:46:48.561149Z

I went ahead and added more detail to cljdoc library authors guide: https://github.com/cljdoc/cljdoc/pull/1164.

🙌 1
🙌🏽 1