Question

I need to update an existing ear file using ant task excluding some of the jar files, which will be available on WAS shared libraries. I don't want to create ear again, need to only update already built ear, as I have seen posts to update ear but those are creating a new ear. My problem is, i don't want to re-create the ear.

This is a way for doing it through maven, but I want to do it through ear task ant.

Thanks.

Était-ce utile?

La solution

The Ant ear, war, and jar tasks might be able to update ears, wars, and jars, but I wouldn't depend upon it. Creating ears is a very quick task -- a few brief seconds, so it was never an issue I explored.

If you can't recreate the ear because the files you need are no longer available, you can try unzipping the ear, set what you need, and rebuild it from scratch.

<unzip src="${ear.file}"
    destdir="${temp.location}"/>
<delete file="${ear.file}"/>

<here be dragons.../>

<zip destfile="${ear.file}"
    basedir="${temp.location}"/>

You could use <patternset/>s, or <zipfileset/>s to control what gets zipped and unzipped, but it's probably easier unzipping and rebuilding.

If it makes you feel better, you can use <ear/> instead of <zip>, but you'll have to specify the appxml parameter. It's just easier to use <zip/>.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top