Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<scm><tag> value in pom.xml is overwritten with incorrect value #841

Closed
pmonks opened this issue Jul 26, 2022 · 6 comments
Closed

<scm><tag> value in pom.xml is overwritten with incorrect value #841

pmonks opened this issue Jul 26, 2022 · 6 comments

Comments

@pmonks
Copy link

pmonks commented Jul 26, 2022

I have a project that publishes artifacts to Clojars, and those artifacts include a pom.xml file that (amongst other things) contains this element:

<scm>
  <url>https:/pmonks/clj-wcwidth</url>
  <connection>scm:git:git:/pmonks/clj-wcwidth.git</connection>
  <developerConnection>scm:git:ssh://[email protected]/pmonks/clj-wcwidth.git</developerConnection>
  <tag>1.0.64</tag>
</scm>

However after deployment, the pom.xml file hosted by Clojars contains this element instead:

<scm>
  <url>https:/pmonks/clj-wcwidth</url>
  <connection>scm:git:git:/pmonks/clj-wcwidth.git</connection>
  <developerConnection>scm:git:ssh://[email protected]/pmonks/clj-wcwidth.git</developerConnection>
  <tag>v1.0.64</tag>
</scm>

Note the letter 'v' added as a suffix to the value of the <tag> nested element.

This value is invalid, as there is no tag v1.0.64 in the source repository, and this causes some downstream tooling to fail. There is a 1.0.64 tag in that repository however, so if the original value that was deployed had been preserved, the downstream tooling would function as expected.

Is there a way to tell Clojars not to mess with any values that I provide in the pom.xml I deploy to it? I'm comfortable for Clojars to augment the data that's there with anything that's missing that Clojars considers mandatory, but overwriting data that I provide seems quite problematic, especially (as in this case) when the Clojars-generated value is invalid.

@tobias
Copy link
Member

tobias commented Jul 26, 2022 via email

@pmonks
Copy link
Author

pmonks commented Jul 26, 2022

Thanks @tobias! I'm at quite a loss then, as another project I checked (not written by me, but one that I've used in some other projects of mine) also has some strange <scm><tag> rewriting going on, and it uses a completely different set of build & deploy tools to what I'm using (I use tools.build+deps-deploy, that project uses Leiningen). I double checked with the author of that project, and he doesn't know how that element got in his pom.xml either.

But if it's not Clojars, the only other possibility I can think of is that both tools.build/deps-deploy and Leiningen use some shared underlying code for building and/or deploying pom.xml files, and it's that code that's erroneously modifying the <scm><tag> value.

@danielcompton
Copy link
Member

Not sure if it helps but the v prefix sounds likes the default behaviour of lein release.

@pmonks
Copy link
Author

pmonks commented Jul 26, 2022

Thanks @danielcompton! Yeah my project (which I have more visibility into / control over, obvs) uses tools.build+deps-deploy, so in theory Leiningen shouldn't be a factor. But perhaps deps-deploy uses some of the same code as lein release?

My current lines of investigation:

  1. try to figure out where META-INF/maven/com.github.pmonks/clj-wcwidth/pom.xml comes from, and why it isn't simply a verbatim copy of ./pom.xml
  2. try to figure out whether deps-deploy reuses any Leiningen code

@pmonks
Copy link
Author

pmonks commented Jul 26, 2022

@pmonks
Copy link
Author

pmonks commented Jul 26, 2022

Ok I think I've found the root cause of the problem. I'll raise an issue against build-clj.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants