Closed jmbruel closed 8 years ago
You're probably not pulling in all the dependencies of Asciidoclet (which there are quite a few). Any reason why you aren't using a CLI build tool?
Guess I'll have to ;-) No reason other than the fact that this is for a course (B.Sc. kind of level) and they are only using scripting techniques so far.
This is a really good point though, we could shade the dependencies of Asciidoclet to make it a single unified jar to avoid problems like this.
I raised the point because I had no problem with the plantuml doclet (also a jar file). http://plantuml.sourceforge.net/doclet.html
I was tinkering around with the shade plugin, if you'd like to try the single-jar result here's a link: https://oss.sonatype.org/content/repositories/snapshots/org/asciidoctor/asciidoclet/1.5.2-SNAPSHOT/asciidoclet-1.5.2-20141128.154014-1.jar ^ Wow, 51 megabytes
This works great in command-line! Thanks a lot. Should make it available :-) Great job.
@benevans, @mojavelinux what are your thoughts on combining the artifact and dependencies into one jar? Personally, I was surprised by the size of the result but I wonder if there's something we can do to reduce this.
@johncarl81 The shaded jar is huge because of a packaging bug introduced in AsciidoctorJ 1.5.0 (and present in 1.5.1). AsciidoctorJ 1.5.2 will be 650K (which doesn't include JRuby). If we can figure out what to take from JRuby specifically, then we might be able to get the contribution from JRuby down.
Another approach here is to create a distribution, which we'll be doing with AsciidoctorJ 1.5.2.
(We've switched to Gradle for the build, which makes creating a distribution jar super simple. It even provides a launcher script).
I guess we'll wait for 1.5.2 for this then.
That's what I recommend. We should have it out by this weekend.
1.5.2 is out!
Btw, what we're talking about here is both a distribution and a fat jar. A distribution is just putting everything in one zip with a launcher script to run the java
command with everything on the classpath (Gradle provides this out of the box). A fat jar is when you stuff everything into a single jar. The convention for naming a fat jar is *-all.jar
or *-complete.jar
.
This should be available in the upcoming 1.5.3 release.
I am trying to use asciidoclet in command line:
javadoc ... -doclet org.asciidoctor.Asciidoclet -docletpath doclet/asciidoclet-1.5.0.jar ...
And I get: javadoc: error - In doclet class org.asciidoctor.Asciidoclet, method optionLength has thrown an exception java.lang.reflect.InvocationTargetException java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableList
Any idea? Thanks in advance