Thursday, August 2, 2012

Copy-maven-plugin Updates

This will be a short post.

I have received a couple of complaints regarding the copy-maven-plugin that I use for copying resources (see the sample poms from my projects). Initially I thought it was just a Maven issue, but it turns out the author has changed the plugin totally (including the repository).

In order to continue using this excellent plugin, you need to update your copy-maven-plugin declaration in the project's pom.xml

What is Copy-maven-plugin?

Most build scripts or applications operate with lots and lots of archives: big, small, huge, "*.zip", and "*.tar.gz". Their content comes from various resources: files, directories, Maven dependencies and other archives, sometimes downloaded from HTTP or FTP. The resulting archives may need to become Maven artifacts and occasionally uploaded back to FTP or SCP.

Eventually, when one needs to perform above operations, the result is usually a messy POM with quite a few plugin configurations and Ant snippets. "copy-maven-plugin" solves this issue and provides an elegant solution for all above tasks. It allows you to easily perform and configure the following operations:

  1. Copy files, directories and Maven dependencies.
  2. Filter and replace text files as they're copied.
  3. Pack, update, and unpack archives, zip entries and Maven dependencies.
  4. Attach archives created as Maven artifacts or deploy them directly to Maven repository manager.
  5. Download and upload archives from and to HTTP, SCP, and FTP.
  6. Use Groovy "extension points" for text replaces, files filtering and post-processing.

See copy-maven-plugin for reference

Updates as of August 12, 2012 6:21pm

Apparently, there are still problems with the latest copy-maven-plugin from goldin. Here are the problems:

  • Latest plugin version uses Maven 3. All of my projects are built on Maven 2. By default, it should be compatible with Maven 3. However, the copy-maven-plugin has some issues working on Maven 2's structure if run on Maven 3.
  • Older version of the copy-maven-plugin no longer exists in its old repository. If it doesn't exist, then you won't be able to retrieve it

And because of these, I've decided to resort to the more standard, though less flexible maven-resources-plugin. You should replace all instances of the goldin plugin (see the pom.xml) with the following:
Thank you.

StumpleUpon DiggIt! Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google I'm reading: Copy-maven-plugin Updates ~ Twitter FaceBook

Subscribe by reader Subscribe by email Share