-2

I have two files test-200-12-30-2990 and test-project-200-12-30-2990 I am unziping it to corresponding folders. Second task is not working. I want to select the file 'test-200-12-30-2990' Below is the ant build.xml. I am using maven ant plugin inside pom

                        <mkdir dir="/testdir"/>
              <unzip dest="src/main/resources/testdir">
                <fileset dir="src/main/resources">
                    <include name="**/test-project*.zip"/>
                </fileset>
             </unzip>
           </target>

                        <mkdir dir="/test-projectdir"/>
              <unzip dest="src/main/resources/test-projectdir">
                <fileset dir="src/main/resources">
                    <include name="**/test[1-9].zip"/>
                </fileset>
             </unzip>
           </target>
maven h
  • 1
  • 2

1 Answers1

0

I'm not quite sure how inclusion might work in Maven, but maybe we could solve this problem with a simple expression that you already have, something maybe similar to:

test-[0-9-]+

Then, the include might look like:

test-[0-9-]+\.zip

**/test-[0-9-]+\.zip

If escaping . might be unnecessary, then we can just use:

**/test-[0-9-]+.zip

DEMO

Reference

Emma
  • 27,428
  • 11
  • 44
  • 69