Maven assembly plugin warning "The assembly descriptor contains a filesystem-root relative reference"

Solution 1:

The working solution is to specify the empty outputDirectory:

<fileSets>
    <fileSet>
        <directory>${basedir}/src/main/resources</directory>
        <outputDirectory></outputDirectory>
    </fileSet>
</fileSets>

Solution 2:

Using an empty outputDirectory element works, but I wouldn't be surprised if somebody assumed it could be safely deleted.

So, to be more explicit, you could also avoid the warning by writing:

<outputDirectory>${file.separator}</outputDirectory>

Solution 3:

Note that this can happen at other locations besides just /. The above answers are correct, but don't cover this case.

Look for something like this in your assembly.xml:

<fileSets>
    <fileSet>
        <directory>${basedir}/src/main/resources</directory>
        <outputDirectory>/lib</outputDirectory>         <!-- <<< look for this -->
    </fileSet>
</fileSets>

and change to this:

<fileSets>
    <fileSet>
        <directory>${basedir}/src/main/resources</directory>
        <outputDirectory>lib</outputDirectory>
    </fileSet>
</fileSets>