How to make the regexp filter work?

Comments

1 comment

  • Avatar
    juanjo

    The patterns are matched against the full path of the file so ^MyProgram$ won't work, as the full path will be something like ${BuildPath}/target/service/.../MyProgram. You could use the below instead:

    <distributionFileList>
            <distributionDirectory>
                <allowWildcards>1</allowWildcards>
                <excludeFiles>*.sh</excludeFiles>
                <origin>${BuildPath}/target/service</origin>
                <onPackingFilterList>
                    <fileNameFilter>
                        <logic>does_not_match</logic>
                        <pattern>*.sh</pattern>
                    </fileNameFilter>
                    <fileNameFilter>
                        <logic>does_not_match</logic>
                        <pattern>^.*/MyProgram$</pattern>
                        <patternType>regexp</patternType>
                    </fileNameFilter>
                </onPackingFilterList>
            </distributionDirectory>
    </distributionFileList>
    

Please sign in to leave a comment.