You do not need to leave any files in the myapp.ear directory. You just need to define a file should be present when the ear is built.
Peter On Wed, Jul 21, 2010 at 1:52 PM, Marina <ppi...@yahoo.com> wrote: > David, Peter, > > thanks for your responses. > > Peter - thanks for the suggestion - I'll try it out.Although in my situation, > I > really do not have any files in the myapp.ear directory, as I remove all > content > before re-building the EAR. I guess I could intentionally leave something > behind... > > David, sorry - you are absolutely right, I've mistyped the result :) > It is indeed returns FALSE (though I would expect TRUE), and as a result the > task in the <sequential> is not being run. > > I've looked at the 'uptodate', and my issue with using it is that it does not > support multiple target files. If I had an archived EAR (just one myapp.ear > file) - it would work fine, but since I'm deploying in the exploded format, I > have the myapp.ear/ directory wit all content exploded as well... > > I was looking at the <mapper> task - but I'm not sure how I could map, say, a > JAR file name to a directory name and all content under it. What I mean is > that > I have a myEjb1.jar (which is one archive file, with the ejb content), and > then > I have a myapp.ear/myEjb1.jar/ directory with the corresponding content . > > I see your point about the ant-contrib being unmaintained right now though - > so > I'll try to stay away from it and use core Ant tasks instead. > > thanks for your response, > Marina > > > > > > ________________________________ > From: Peter Reilly <peter.kitt.rei...@gmail.com> > To: Ant Users List <user@ant.apache.org> > Sent: Wed, July 21, 2010 5:16:42 AM > Subject: Re: outofdate task returns TRUE if no target files exist?? > > The problem is that you are specifying no targetfiles. > > In this case, I normally pick a scapegoat file that I know should > always be present. - ${destination}/myapp.ear/WEB-INF/web.xml > or some such file. > > <targetfiles> > <fileset dir="${destination}/myapp.ear" includes="**/*"/> > <path path="${destination}/myapp.ear/WEB-INF/web.xml"/> > </targetfiles> > > > I suppose that one could change <outofdate> to always trigger if > there are no <targetfiles> as that is a common use case. > > Peter > > > On Tue, Jul 20, 2010 at 8:35 PM, Marina <ppi...@yahoo.com> wrote: >> Hi, I wanted to see if the behavior I see when using the ant-contrib's >> 'outofdate' task is a correct one. Basically, I'm trying to determine if >> generated EAR archive (in the exploded form) has any out of date files in >> respect to the source directories, and re-copy those files if so. >> Here is my task: >> <target name="check.ear.exploded.uptodate" > >> <outofdate property="ear.not.uptodate"> >> <sourcefiles> >> <fileset dir="${build.jars}" >> includes="*.jar"/> >> <fileset dir="${build.wars}" >> includes="*.war"/> >> <fileset dir="${basedir}/rsrc/deployment" >> includes="application.xml"/> >> </sourcefiles> >> <targetfiles> >> <fileset dir="${destination}/myapp.ear" includes="**/*"/> >> </targetfiles> >> <sequential> >> <echo message="exploded myapp.ear dir is not uptodate - >> rebuilding"/> >> </sequential> >> </outofdate> >> </target> >> >> Now, if there are no files in the "${destination}/myapp.ear" directory yet > (I'm >> building for the first time after cleanup) - the outofdate task still returns >> TRUE. Needless to say, I would prefer the opposite behavior - if no target >>files >> exist - consider them out-of-date. >> Is this the expected behavior or am I missing something? >> Also, I hope this is the right forum to post this question to; if not - >> please >> let me know. >> >> Thanks! >> Marina > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@ant.apache.org > For additional commands, e-mail: user-h...@ant.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org