Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure CLI by
closed by

Clojure Version: 1.11.1.1267
OS: macOS 13.x

The command clj -Spom is not working as expected, and generated pom.xml doesn't show any dependencies.
Flags -X:deps list and -X:deps tree work as expected, and they solve correctly the deps file deps.edn, but the flag -Spom cannot generated a valid pom.xml (it doesn't contain any dependency).
Tested on the repo: https://github.com/clojure/tools.deps

Output clj -Spom && cat pom.xml (1.11.1.1267)

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <packaging>jar</packaging>
  <groupId>tools.deps</groupId>
  <artifactId>tools.deps</artifactId>
  <version>0.1.0</version>
  <name>tools.deps</name>
  <dependencies/>
  <repositories/>
</project>

Output clj -Spom && cat pom.xml (1.11.1.1165)

Skipping paths: src/main/resources
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <packaging>jar</packaging>
  <groupId>tools.deps</groupId>
  <artifactId>tools.deps</artifactId>
  <version>0.1.0</version>
  <name>tools.deps</name>
  <dependencies>
    <dependency>
      <groupId>javax.inject</groupId>
      <artifactId>javax.inject</artifactId>
      <version>1</version>
    </dependency>
    <dependency>
      <groupId>org.clojure</groupId>
      <artifactId>clojure</artifactId>
      <version>1.10.3</version>
    </dependency>
    <dependency>
      <groupId>com.cognitect.aws</groupId>
      <artifactId>api</artifactId>
      <version>0.8.612</version>
    </dependency>
    <dependency>
      <groupId>com.cognitect.aws</groupId>
      <artifactId>endpoints</artifactId>
      <version>1.1.12.321</version>
    </dependency>
    <dependency>
      <groupId>org.clojure</groupId>
      <artifactId>tools.cli</artifactId>
      <version>1.0.214</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.resolver</groupId>
      <artifactId>maven-resolver-transport-http</artifactId>
      <version>1.8.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.resolver</groupId>
      <artifactId>maven-resolver-transport-file</artifactId>
      <version>1.8.2</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.11.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>3.8.6</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.resolver</groupId>
      <artifactId>maven-resolver-api</artifactId>
      <version>1.8.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-resolver-provider</artifactId>
      <version>3.8.6</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>31.1-android</version>
    </dependency>
    <dependency>
      <groupId>org.clojure</groupId>
      <artifactId>data.xml</artifactId>
      <version>0.2.0-alpha8</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.resolver</groupId>
      <artifactId>maven-resolver-spi</artifactId>
      <version>1.8.2</version>
    </dependency>
    <dependency>
      <groupId>org.clojure</groupId>
      <artifactId>tools.gitlibs</artifactId>
      <version>2.5.190</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.resolver</groupId>
      <artifactId>maven-resolver-connector-basic</artifactId>
      <version>1.8.2</version>
    </dependency>
    <dependency>
      <groupId>com.cognitect.aws</groupId>
      <artifactId>s3</artifactId>
      <version>822.2.1145.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.resolver</groupId>
      <artifactId>maven-resolver-impl</artifactId>
      <version>1.8.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.resolver</groupId>
      <artifactId>maven-resolver-util</artifactId>
      <version>1.8.2</version>
    </dependency>
  </dependencies>
  <build>
    <sourceDirectory>src/main/clojure</sourceDirectory>
  </build>
  <repositories>
    <repository>
      <id>clojars</id>
      <url>https://repo.clojars.org/</url>
    </repository>
  </repositories>
</project>

So 1.11.1.1165 output is the expected output, but 1.11.1.1267 behavior is different. The command clj -X:deps pom doesn't work.

Is this a bug or a legit behavior in 1.11.1.1267? How can I generate a valid pom.xml, containing all the dependency, from my deps.edn?

closed with the note: Fixed in Clojure CLI 1.11.1.1273

1 Answer

0 votes
by

Interesting, must have broken that recently, I will take a look. Really though, you can use clj -X:deps mvn-pom instead. -Spom will probably eventually go away.

by
Hi Alex,

Thanks for your reply. I can confirm `clj -X:deps mvn-pom` works in `1.11.1.1267`, but it is not listed in `clj --help`.  The first version of `clj` where `-Spom` stopped working should be `1.11.1.1252` (6th March), according to some quick tests.
by
I have fixed the help and the regression for the next release.
...