Hello, The xml code below is to exclude a file name "MyProgram" from the pack, but it can' work, what's wrong with it?

<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>

asked 25 Apr '12, 03:49

laiyongyong's gravatar image

laiyongyong
1131314
accept rate: 0%


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>
link

answered 25 Apr '12, 04:49

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

Hi, Yes, it works! thank you!

(25 Apr '12, 22:58) laiyongyong

Is it possible to conditionalize the filter groups based upon an installer variable?

(03 Apr '13, 20:51) quang777
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×50
×2

Asked: 25 Apr '12, 03:49

Seen: 1,243 times

Last updated: 03 Apr '13, 20:51