Maven-dependency-plugin: decompression fails in Eclipse

I have a JavaScript library depending on globalmentor-core.jar, and I'm using the maven dependency in another project to transfer JavaScript to a web directory:

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.1</version> <executions> <execution> <id>unpack</id> <phase>process-resources</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>com.globalmentor</groupId> <artifactId>globalmentor-core</artifactId> <overWrite>true</overWrite> <outputDirectory>${project.build.outputDirectory}/com/guiseframework/assets/javascript</outputDirectory> <includes>**/*.js</includes> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> 

This works great on the command line. In Eclipse using m2eclipse I get:

 2/4/11 5:26:53 AM PST: Build errors for guiseframework; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack (unpack) on project guiseframework: Error unpacking file: R:\java\trunk\globalmentor-core\target\classes to: R:\java\trunk\guiseframework\target\classes\com\guiseframework\assets\javascript org.codehaus.plexus.archiver.ArchiverException: The source must not be a directory. 

The closest thing I can find is http://jira.codehaus.org/browse/MDEP-187 , where someone claims that they will "provide a trivial patch" soon. That was in 2008.

Is there a fix for this, or am I stuck?

+6
eclipse maven m2eclipse maven-dependency-plugin
source share
1 answer

I found a solution / workaround for this problem.

My configuration: Windows XP SP 3, Maven 3, JDK 1.6.0_24, the Maven repository in the folder "C: \ Documents and Settings \ <YOUR_ID> \. M2".

Follow these steps:

  • Run 'dir c: \ / X and find the line with ~ in it

    01/08/2011 04:53 PM DOCUME ~ 1 Documents and Settings

  • Open the settings.xml file and under the <settings> tag add the localRepository tag:
    <& localRepository ยฐ : / DOCUME ~ 1 / <your_ID> / m2 / l & repository; \ localRepository> .

This should make the plugin work. Apparently, the maven-dependency-plugin (prior to version 2.3) has problems with paths, including spaces in it.

Yours faithfully,
Cutberto.

+2
source share

All Articles