Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven assembly plugin: Failed to retrieve numeric file attributes using: '/bin/sh -c ls -1nlaR

I am running parallels with Debian on my OSX 10.7.5 and I have linked a directory with Java sources from OSX to the virtual Debian machine (using Parallels tools, which mount directories to /media/psf/).

Compilation works correctly, only problem I have is with Maven Assembly plugin: which complains:

Failed to retrieve numeric file attributes using: '/bin/sh -c ls -1nlaR

I googled following issue: http://jira.codehaus.org/browse/MASSEMBLY-588

They suggest using <directory>${baseDir}</directory> in jarlib.xml. With this modification, the code compiles, but when checking the contents with jar tf file.jar, it is completely missing all the compiled sources, only maven libraries are added.

The file, which works correctly on local filesystem is:

<assembly>
  <id>jar-with-dependencies</id>
  <formats>
    <format>jar</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>
  <fileSets>
    <fileSet>
      <directory>target/classes</directory>
      <outputDirectory>/</outputDirectory>
    </fileSet>
  </fileSets>
  <dependencySets>
    <dependencySet>
      <outputDirectory>/lib</outputDirectory>
      <unpack>false</unpack>
      <scope>runtime</scope>
    </dependencySet>
  </dependencySets>
</assembly>

Is there a way to overcome this issue?

Edit:

Apache Maven 2.2.1 (rdebian-4)
Java version: 1.6.0_26
Java home: /usr/lib/jvm/java-6-sun-1.6.0.26/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-5-amd64" arch: "amd64" Family: "unix"
like image 735
Vojtěch Avatar asked Nov 26 '12 15:11

Vojtěch


1 Answers

/bin/sh -c ls -1nlaR {directory_structure/file}
I resolved it by renaming folder which was having Apostrophe(') in directory_structure.

This problem is created because maven assembly while executing command /bin/sh -c ls -1nlaR {directory_structure/file} not escaping the Apostrophe(').

like image 77
user3753214 Avatar answered Nov 09 '22 23:11

user3753214