gradle-download-task: download files with progress

I really like how Gradle displays progress while it’s fetching artifacts from Maven repositories, but I was always wondering why you cannot use the same functionality when you’re downloading arbitrary files in your build script. You can of course use Ant’s download task to fetch files, but it does not display progress information. Since I couldn’t find a solution on the Internet I decided to write a plugin.

gradle-download-task has initially been released in September 2013 and is now available in version 1.0. The plugin contributes a download task that shows progress information just like Gradle does when it fetches artifacts from a repository.

You can use it like this:

task downloadFile(type: Download) {
    src ''
    dest buildDir

The output will look like this:

> Building > :downloadFile > 320 KB/6,78 MB downloaded

In order to use the plugin you have to add the following lines to your build file:

buildscript {
    repositories {
    dependencies {
        classpath 'de.undercouch:gradle-download-task:1.0'


You can also use the download extension to retrieve a file anywhere in your build script:

apply plugin: 'download-task'

task myTask << {
    //do something ...
    //... then download a file
    download {
        src ''
        dest buildDir
    //... do something else

With version 1.0 you can now also sequentially download a list of files to a directory. Please note that you have to specify a directory as destination if you download multiple files. Otherwise the plugin will fail.

task downloadMultipleFiles(type: Download) {
    dest buildDir

Many thanks go to Bright Fulton who contributed support for custom HTTP request headers. You can use this new feature as follows:

task downloadWithCustomHeader(type: Download) {
    src ''
    dest buildDir
    header 'Cookie', 'oraclelicense=accept-securebackup-cookie'

The plugin supports a wide range of other options. Please read the README file for more information.

Happy downloading!

Command line tool for citations and bibliographies

I was working very hard on the new version of citeproc-java lately and I’m glad to announce that it has just been released. The highlights in version 0.6 are:

  • The binary distribution of citeproc-java contains a command line tool that can be used to generate citations and bibliographies without setting up a complete development environment. Just download and extract the zip file and then run citeproc-java -b references.bib -s ieee to create a bibliography in ieee style for your BibTeX input file. This feature makes the library very useful even for non-programmers.
  • The new Mendeley connector allows you to use documents stored in Mendeley Web as input for citations and bibliographies. Of course this feature also works on the command line.
  • The library has been tested with the CSL test suite. All 750+ tests run successfully! I put a lot of work into this to bring citeproc-java on par with other CSL processors.
  • Performance has been improved a lot.

I particularly like the new command line tool that can be used to generate citations and bibliographies from various sources such as BibTeX files or your Mendeley Web catalog. I expect the tool to be quite useful for the following users:

  • Authors who want a quick way to preview citations or bibliographies in various styles
  • Citation Style Language style authors who want to test their style files very quickly

In order to use the tool you just have to download citeproc-java and extract the ZIP file. Then you can run the following command to convert a BibTeX file to a bibliography using the ieee style, for example:

citeproc-java -b references.bib

If you want to generate a bibliography that only contains items with certain citation IDs (for example Fowler_2010 and Kisker_2012) use the following command:

citeproc-java -b references.bib Fowler_2010 Kisker_2012

The tool will even notify you if you misspelled a citation ID:

citeproc-java: unknown citation id: Fwler_2010
Did you mean `Fowler_2010'?

If you want to connect to your Mendeley Web account, use the following command:

citeproc-java --mendeley Fowler_2010 Kisker_2012

The tool has a lot more to offer. For more information run citeproc-java --help or read the library’s documentataion.

Generating citations and bibliographies with CSL and citeproc-java

I was recently writing a scientific document with AsciiDoc. As usual my toolchain was AsciiDoc → DocBook → FO → PDF. It really worked quite well until I came to the point where manually adding citations and editing the biblioghraphy by hand became really complex and I suddenly found myself yearning for more automation.

I asked Google what I could do and Google told me about BibTeX and all that stuff. There even was a tool called asciidoc-bib by Peter Lane that was able to read BibTeX files to generate citations and bibliographies and then put them into an AsciiDoc source file. I tested this tool for a while and contributed one or two commits via GitHub. However, I was not yet convinced by the flexibility and maturity of asciidoc-bib by that time, so I started looking for ways how to extend it.

Enter the Citation Style Language (CSL). CSL is an XML-based description of citation styles and bibliographies that’s maintained by a number of people from the scientific community. They say it’s “by academics, for academics”. I really loved the idea of having a more modern alternative to BibTeX and natbib which I never found particularly mind-blowing by the way.

I started with extending asciidoc-bib with support for a library called citeproc-ruby by Sylvester Keil. citeproc-ruby is a so-called CSL processor. That means it reads CSL styles and transforms them to citations and bibliographies. However, I still found asciidoc-bib too cumbersome to use, in particular since it was written in Ruby and my toolchain was based on Java.

So I asked Google again, if they could tell me something about CSL and Java, but they said they didn’t know very much about that. That was when I finally decided to write my own CSL processor for Java.


Today I’m pleased to announce the first release of citeproc-java, a CSL processor for Java! An (almost) complete documentation is available at the following site:

I have to be honest with you guys. I didn’t implement the whole CSL specification myself. Instead I tried to incorporate existing code as much as possible. citeproc-java uses the great citeproc-js by Frank G. Bennett, Jr. internally. It is therefore fully CSL 1.0.1-compliant. Apart from that, it offers some cool additional features such as BibTeX import as well as export to AsciiDoc and FO.

For convenience I uploaded citeproc-java and the CSL styles and locales to Maven central. Please see the installation instructions for more information:

citeproc-java’s BibTeX to CSL mapping is based on the one used in the Docear software. It has been converted to Java by permission from the Docear authors, in particular Joeran Beel. The BibTeX converter imports author names using the name parser from the citeproc-ruby project. It has been converted to Java by permission from Sylvester Keil. Thank you very much for that!

Although citeproc-java is a very young project and this is the very first release, I consider it rather stable already—not least because it uses citeproc-js under the hood. Nevertheless, development of citeproc-java has just begun and I’m sure there are great features to come. If you want to participate, don’t hesitate to fork my GitHub repository and send me pull requests:

Finally, big thanks go to the CSL community for the great work and support!


citeproc-java is licensed under the Apache License, Version 2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

bson4jackson 2.2 has just been released!

Version 2.2 of bson4jackson has just been released. bson4jackson adds support for BSON, a binary representation of JSON, to the Jackson JSON processor.

The latest release of bson4jackson now supports Jackson 2.2. Apart from that, Ben McCann and John Stoneham fixed the Maven dependencies and updated some 3rd party libraries, so project builds depending on bson4jackson should now be more stable. Thanks a lot for that, guys!

Projects using bson4jackson

bson4jackson is used in several other Open Source projects including the following one:

  • Jongo is a rather cool library that allows MongoDB to be queried in Java just like you would query it in the MongoDB shell. Jongo uses bson4jackson to serialize objects before they are sent to the database, and of course to deserialize queried documents.

  • MongoJack is a POJO mapper that uses Jackson and bson4jackson to serialize and deserialize objects before they are sent to the database. MongoJack is extremely fast and very easy to handle.

I know that there are a lot of other projects out there that use bson4jackson. If you want your project to be added to this list please leave a comment below or send me a message.

More information

For a complete description of bson4jackson (including how to download it) have a look at my tutorial.

Spamihilator website now Open Source

I’ve just released the source code of the Spamihilator website as Open Source. You can download it from the following GitHub repository:

Everyone is invited to make contributions! I’m open to all kind of changes. You may submit new content (e.g. FAQ), change the design or style, etc.

If you want to contribute please fork the GitHub repository and send me pull requests. I will check and upload them to the Spamihilator web server as soon as possible. Further instructions can be found below or in the README file.


The Spamihilator website has been created using Jekyll. If you want to build it please follow these steps:

  1. Download and install Ruby 1.8.7 (if you haven’t done so already).

    Under Windows I recommend to use RubyInstaller. Under Linux and Mac OS I highly recommend to use rvm as the repository already contains proper .ruby-version and .ruby-gemset files.

  2. Install the bundler gem (if you haven’t done so already).

    gem install bundler

  3. Clone or download this repository.

  4. Open a command line shell in the cloned directory and enter the following command:

    bundle install

  5. After that you are ready to build the website using the following commands:

    compass compile

  6. Repeat these commands whenever you make a change. The files will be compiled to the subdirectory _site.

Run locally

You may also run and test the website locally before uploading your changes. In order to do this, follow the instructions above and then run the following command:

jekyll --server

Launch a web browser and open http://localhost:4000 to view the site. For more information see Jekyll’s website.


Creative Commons License
If not noted otherwise the files in the Spamihilator website repository are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.