Closed tiye closed 4 years ago
Tried many times and by reading the stack trace, I think it's happening when there's an existing pom.xml
file. The program tries to read it, but somehow got an exception.
https://github.com/workframers/garamond/blob/master/src/garamond/pom.clj#L20
Or probably it's because I don't have a :paths
field in my deps.edn
...
XML is weird.. now the exception's gone, but I got multiple lines of.... 😓
<sourceDirectory>src</sourceDirectory>
<sourceDirectory>src</sourceDirectory>
<sourceDirectory>src</sourceDirectory>
Odd. Seems like an upstream thing with garamond's handling of the pom.. did you have an existing pom before?
small note, it looks like your :scm-url
is still github/mhuebert/deps-library
Odd. Seems like an upstream thing with garamond's handling of the pom.. did you have an existing pom before?
I published once and a pom.xml
stays. I added it to .gitignore
after that. I thought the file was left there intentionally?
small note, it looks like your :scm-url is still github/mhuebert/deps-library
Oh, I forgot to change it..
I published once and a pom.xml stays. I added it to .gitignoreafter that. I thought the file was left there intentionally?
It should be ok either way. I was more wondering if the existing pom.xml could have already been badly formatted in some way. Did you try deleting the existing pom and starting fresh? Can run clj -A:release pom
to just run the pom step.
Did you try deleting the existing pom and starting fresh?
yep and that worked.
After I added :paths
I think it's already working. Just strangely it's adding a line of (not reproducing...)<sourceDirectory>src</sourceDirectory>
each time I run release
...
running clj -A:release pom
generates a file:
<?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>
<groupId>mvc-works</groupId>
<artifactId>skir</artifactId>
<version>0.0.7-a1</version>
<name>skir</name>
<dependencies/>
<build>
<sourceDirectory>src</sourceDirectory>
</build>
<repositories/>
<scm>
<url>https://github.com/mvc-works/skir</url>
<tag>ceea133b6dec0bbe5c1a608f0cf71fd1dae01440</tag>
<connection>scm:git:git@github.com:mvc-works/skir.git</connection>
<developerConnection>scm:git:git@github.com:mvc-works/skir.git</developerConnection>
</scm>
</project>
ok. I can fully reproduce this issue by generating a fresh pom from a deps.edn
that does not contain :paths
, and generating a pom. That pom won't contain any sourceDirectory
and on the next run I will see the Premature end of file
error. Then, if I add :paths ["src"]
, subsequent poms will not throw errors, but keep adding <sourceDirectory> ... </sourceDirectory>
entries to the end of the file, not inside of a <build> .. </build>
. An immediate solution is to delete the pom and generate a new one with a :paths
entry already inside deps.edn
.
An immediate solution is to delete the pom and generate a new one with a :paths entry already inside deps.edn.
okay, already doing that~
I believe the bug is an upstream issue with garamond/pom: https://github.com/workframers/garamond/issues/8
agreed. is there any plan to validate deps.edn
? there's chances people may have typos in EDN files...
I'd say that's out of scope for this library but agree it would be useful. In this case I think the bug is really in Garamond, as their explicit intention is to follow what Spom
does, and Spom
doesn't care if there is no :paths
key.
Forgot to ask, does deps-library
read configures from deps.edn
?
like dependencies specified in tried and turned out just via deps.edn
, when my package depends on those packages, does deps-library
read that from deps.edn
(or maybe just via pom.xml)?pom.xml
...
It does read from deps.edn
, via the sync-pom
function of tools.deps.alpha: https://github.com/clojure/tools.deps.alpha/blob/master/src/main/clojure/clojure/tools/deps/alpha/gen/pom.clj#L126
Following conversation on ClojureVerse.. The code I changed to try 0.3.0 https://github.com/mvc-works/skir/commit/8ecb0d04ac70668c64334cbbc94483f8aa9c4efc
Also the
pom.xml
file looks a bit strange to me,