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

前端 未结 3 2012
挽巷
挽巷 2020-12-30 18:35

Starting from some assembly plugin version maven builds issue the following warning:

[WARNING] The assembly descriptor contains a filesystem-root rela

相关标签:
3条回答
  • 2020-12-30 19:25

    The working solution is to specify the empty outputDirectory:

    <fileSets>
        <fileSet>
            <directory>${basedir}/src/main/resources</directory>
            <outputDirectory></outputDirectory>
        </fileSet>
    </fileSets>
    
    0 讨论(0)
  • 2020-12-30 19:29

    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>
    
    0 讨论(0)
  • 2020-12-30 19:29

    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>
    
    0 讨论(0)
提交回复
热议问题