Search code examples
apacheantjarcopyear

Is there any possible to copy files into an existing EAR with Ant?


Is there any way, any task to make this instruction directly or it is impossible to make this without the sequence: "unzip", "copy" and "jar" tasks ?

I did tried directly with task copy but without success...

<copy todir="${ear.project}/servico.jar/META-INF" overwrite="true">
                    <fileset dir="${dir.resources}/r2">
                        <include name="ejb-jar.xml"/>
                    </fileset>
                    <flattenmapper/>
        </copy>

Please, i´m waiting for some help.


Solution

  • The EAR and Jar tasks, like the more general Zip task, have an update attribute which when set to true will simply update rather than overwrite an existing archive.