1

Because some guys forgot to set the junit scope to "test", it has been packaged along with our libraries. Since we don't need junit in our final product, I wanted to exclude the class files in an unzip task.

Note: This task is necessary in the further build process, so leaving this out is not an option.

So far my unzip statement looks like this:

<unzip dest="${classes.dir}">
    <fileset refid="dependency.fileset"/>
    <patternset>
        <exclude name="META-INF/*"/>
        <exclude name="org/junit/**/*.class"/>
        <exclude name="junit/**/*.class"/>
    </patternset>
</unzip>

I tried various combinations, but the junit and META-INF files magically reappear each time. As a work-around I added a delete statement with a fileset. It works but is completely unnecessary if I have the option to add a patternset to the unzip statement - in my opinion:

<delete includeemptydirs="true">
    <fileset dir="${classes.dir}" casesensitive="false" includes="META-INF/*,junit/**/*,org/junit/**/*" />
</delete>

I already read through the manual, but found no clue on how to solve this problem.

Did I miss something, are the patterns incorrect or is it something else?

spaceemotion
  • 1,404
  • 4
  • 24
  • 32

0 Answers0