i.am.michiel
i.am.michiel

Reputation: 10404

Why is Ant's default exclude not working?

I'm using Ant for "Continous integration". One of my tasks is copying folders from one point to another. Here is my task.

<target name="copy-new">
    <copy todir="/files/apps/blog/" verbose="true">
        <fileset dir=".">
            <exclude name="**/.git" />
            <exclude name="**/.gitignore" />
            <exclude name="**/pom.xml" />
            <exclude name="**/build.xml" />
            <exclude name="**/readme" />
            <exclude name="**/tmp" />
        </fileset>
    </copy>
</target>

As the official documentation says, there are default excludes such a .git folder etc.

But my logs are showing this : (there are many more)

...
[copy] Copying /var/lib/jenkins/jobs/blog/workspace/.git/objects/19/5d7e2de34db6ecc5078c477eb26d0684f68bb7 to /files/apps/blog/.git/objects/19/5d7e2de34db6ecc5078c477eb26d0684f68bb7
...

How to add these files to ignore filter?

Upvotes: 0

Views: 1869

Answers (1)

nfechner
nfechner

Reputation: 17525

Like this:

<target name="copy-new">
    <copy todir="/files/apps/blog/" verbose="true">
        <fileset dir=".">
            <exclude name="**/.git/**" />
            <exclude name="**/.gitignore" />
            <exclude name="**/pom.xml" />
            <exclude name="**/build.xml" />
            <exclude name="**/readme" />
            <exclude name="**/tmp/**" />
        </fileset>
    </copy>
</target>

Upvotes: 3

Related Questions