Maven Copy Files and Folders Plugin not copeying linux [dot] “.*” hidden files

血红的双手。 提交于 2019-12-11 03:16:49

问题


I have a maven code

    <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
            <execution>
                <id>copy-resources-from-parent</id>
                <phase>initialize</phase>
                <goals>
                    <goal>copy-resources</goal>
                </goals>
                <configuration>
                    <outputDirectory>./target/aut-ws</outputDirectory>
                    <resources>
                        <resource>
                            <directory>/prj//workspace-Fm-aut-Testing/</directory>
                        </resource>
                    </resources>
                </configuration>
            </execution>
        </executions>
    </plugin>

This is working fine, but it is not copying .* linux files which are hidden. In normal linux we would use a parameter -a. How to use this here?

Thanks Jeevan


回答1:


To disable this behaviour set addDefaultExcludes to false.

<plugin>
    <artifactId>maven-resources-plugin</artifactId>
    <version>3.1.0</version>
    <configuration>
        <addDefaultExcludes>false</addDefaultExcludes>
    </configuration>
</plugin>

By default files like .gitignore, .cvsignore etc. are excluded which means they will not being copied. If you need them for a particular reason you can do that by settings this to false.

Documentation: https://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html#addDefaultExcludes



来源:https://stackoverflow.com/questions/31961775/maven-copy-files-and-folders-plugin-not-copeying-linux-dot-hidden-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!