Completed
Details
Assignee
Alex MillerAlex MillerReporter
Steve MinerSteve MinerLabels
Approval
OkPatch
CodePriority
MinorAffects versions
Fix versions
Details
Details
Assignee
Alex Miller
Alex MillerReporter
Steve Miner
Steve MinerLabels
Approval
Ok
Patch
Code
Priority
Affects versions
Fix versions
Created February 11, 2013 at 4:03 PM
Updated December 16, 2015 at 9:18 PM
Resolved December 16, 2015 at 9:18 PM
The "sources" jar (at least since Clojure 1.4 and including 1.5 RC) has a bad version.properties file in it. The resource clojure/version.properties is literally:
The regular Clojure jar has the correct version string in that resource.
I came across a problem when I was experimenting with the sources jar (as used by IDEs). I naively added the sources jar to my classpath, and Clojure died on start up. The bad clojure/versions.properties file was found first, which led to a parse error as the clojure version was being set.
Cause: We configure the maven-source-plugin plugin in our pom.xml to exclude the clojure/version.properties file, and this works for SNAPSHOT builds but NOT for release builds. One difference during release builds is that we are running different goals and profiles, which seems to cause the configuration for the maven-source-plugin to be configured as defined in the oss-parent pom (https://repo1.maven.org/maven2/org/sonatype/oss/oss-parent/7/oss-parent-7.pom) instead of our configuration, and so the exclusion is not done.
Solution: If we use the same execution id as used in the oss-parent for the maven-source-plugin configuration, our configuration will override the parent pom configuration and the exclusion will take effect, both in snapshot builds and in release builds. The patch makes this change, just using "attach-sources" as the execution id.
Patch: clj-1161.patch
I was able to reproduce the bad source jar locally by running a command like:
Note that this will generate some local files AND make a local tag and commit! So be careful testing locally if you have commit access (Stu!). You can undo that commit with `git reset HEAD~1` and the tag with `git tag -d whatever`. Before the patch, you should see:
After, you should see that target/clojure-1.8.0-xyz-sources.jar does not contain clojure/version.properties at all: