Pregunta

I have Maven 3.0.4 and am trying to make an assembly out of a couple of other artifacts. When using maven-assembly-plugin if I use a it unpacks the artifact contents in the right place, but loses executable permissions on files (e.g. in a /bin directory). I've tried unpacking the dependency into target/ (I see permissions are still okay) and then using to copy them into the assembly, but again, file permissions are lost. It would be really bad if I had to manually go through the dependency to figure out which files are executable.

Anybody have a way to work around these apparent bugs? Is it even possible to copy the files from their temp directory directly into the assembly final location and maintain permissions? If so, how?

¿Fue útil?

Solución

I finally found the answer. The pom file that was the parent pom of the subproject where the assembly was being built had declared a workaround a couple years ago for maven-assembly-plugin bug MASSEMBLY-449. As part of that suggested workaround an block was entered, with a default fileMode of 644. This was back when maven was on 2.2 and the m-a-p was also at 2.2. We switched to maven 3.0.4 and the m-a-p was updated to 2.4 a few months ago. By that point the bug was fixed. Apparently that fix meant that the workaround was no longer needed, and in fact interfered with execute-bit settings. When I removed the block, all the execute permissions for both and entries were once again correct.

Otros consejos

The pom would really help here. Are you are using <directoryMode> and/or <fileMode> in your dependency set, e,g.:

<dependencySet>
    <outputDirectory>someDir</outputDirectory>
    <outputFileNameMapping></outputFileNameMapping>
    <unpack>true</unpack>
    <useTransitiveDependencies>false</useTransitiveDependencies>
    <useProjectArtifact>false</useProjectArtifact>
    <useProjectAttachments>true</useProjectAttachments>
    <includes>
        <include>artifactA</include>
    </includes>
    <directoryMode>0755</directoryMode>
    <fileMode>0755</fileMode>
</dependencySet>

<fileSet> has the same options.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top