You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Dean Hiller <de...@alvazan.com> on 2010/05/19 22:16:50 UTC
Re: should be an easy Filtering question?
This question should be really easy....I would assume even novices would
know the answer here?? Any takers....please!!!! I would really like to get
this working.
On Wed, May 19, 2010 at 11:46 AM, Dean Hiller <de...@alvazan.com> wrote:
> I am missing just one more thing. The doc here
> http://maven.apache.org/guides/getting-started/index.html#How_do_I_filter_resource_files
>
> is about slipping in property files oddly enough not about filtering out
> files(I just want to exclude one folder during the build). I see the
>
> <filters>
> <filter>some properties file for slipping in params</filter>
> </filters>
>
> How do I add my exclusion of my res folder?
>
> I tried copying the example you gave into the build element and adding
> excludes as well...
>
> <resources>
> <resource>
> <directory>src/main/webapp</directory>
> <filtering>true</filtering>
>
> <excludes>
> <exclude>**res**</exclude>
> </excludes>
>
> </resource>
> </resources>
>
> Still not working :(
>
> thanks,
> Dean
>
>
> On Wed, May 19, 2010 at 11:29 AM, Moll, Jeff <JM...@glhec.org> wrote:
>
>> Make sure you have the resource filtering turned on. By default it is
>> not so you will need something like this:
>>
>> <build>
>> <resources>
>> <resource>
>> <directory>src/main/resources</directory>
>> <filtering>true</filtering>
>> </resource>
>> </resources>
>> </build>
>>
>>
>>
>> -----Original Message-----
>> From: dean.hiller@gmail.com [mailto:dean.hiller@gmail.com] On Behalf Of
>> Dean Hiller
>> Sent: Wednesday, May 19, 2010 12:03 PM
>> To: Maven Users List
>> Subject: Re: move folder from res to res${BUILD_NUMBER} easy Filtering
>> problem...
>>
>> ok, so tried out my solution and the copy is working ;) but it is not
>> filtering our the res folder in the war file plugin for some reason.
>> How do I fix this xml so it filters out res folder...
>>
>> <execution>
>> <phase>test</phase>
>> <goals>
>> <goal>run</goal>
>> </goals>
>> <configuration>
>> <tasks>
>> <echo message="Running jboss ant
>> tasks"/>
>> <mkdir
>> dir="${project.build.directory}/${project.name
>> }-${project.version}/res-${BUILD_NUMBER}"/>
>> <copy
>> todir="${project.build.directory}/${project.name
>> }-${project.version}/res-${BUILD_NUMBER}">
>> <fileset
>> dir="src/main/webapp/res">
>> <include name="**"/>
>> </fileset>
>> </copy>
>> <copy
>> file="src/main/descriptors/jboss/WEB-INF/components.xml"
>>
>> tofile="${project.build.directory}/${project.name}-${project.version}/WE
>> B-INF/components.xml"
>> />
>> </tasks>
>> </configuration>
>> </execution>
>> </executions>
>> </plugin>
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-war-plugin</artifactId>
>> <version>2.0</version>
>> <configuration>
>> <webResources>
>> <resource>
>> <!-- this is relative to the pom.xml
>> directory
>> -->
>> <directory>src/main/webapp</directory>
>> <!-- the list has a default value of **
>> -->
>> <excludes>
>> <exclude>res**</exclude>
>> </excludes>
>> </resource>
>> </webResources>
>>
>> <archive>
>> <manifestEntries>
>>
>> <Svn-Revision>${SVN_REVISION}</Svn-Revision>
>> <Build-Tag>${BUILD_TAG}</Build-Tag>
>>
>> <Build-Number>${BUILD_NUMBER}</Build-Number>
>> <Build-Id>${BUILD_ID}</Build-Id>
>> </manifestEntries>
>> </archive>
>> </configuration>
>> </plugin>
>>
>> On Wed, May 19, 2010 at 8:53 AM, Dean Hiller <de...@alvazan.com> wrote:
>>
>> > heh, I went that direction and that hosed my dev environment up/SCM
>> > such taht SCM wanted to check the changes in(I then figured it is
>> > really a bad idea to generate files at all during a build in the src
>> > or input directories).
>> >
>> > but as in my last email, I think I am close to a solution. Just have
>> > to try it after we fix our artifactory from being filled up.
>> >
>> > Dean
>> >
>> >
>> >
>> > On Wed, May 19, 2010 at 8:49 AM, Ron Wheeler <
>> > rwheeler@artifact-software.com> wrote:
>> >
>> >> Can you not figure out a way to rename the source of the copy so that
>>
>> >> the names are changed before maven moves them to the output?
>> >>
>> >> Ron
>> >>
>> >>
>> >>
>> >> On 19/05/2010 10:20 AM, Dean Hiller wrote:
>> >>
>> >>> actually, this pattern is very typical to release new versions of
>> >>> css, js, etc. Projects like richfaces and TinyMCE both use this
>> >>> pattern(not to mention many more). I don't know of any other way to
>>
>> >>> get css, js fixes immediately out to customers without the
>> >>> renaming(in fact, I doubt a better solution exists here as this
>> >>> solution has worked great for our last 4 releases but I am open to
>> >>> ideas).
>> >>>
>> >>> As far as ${project.build.outputDirectory}, I did try that but that
>> >>> seems to deal with the target/classes directory which then goes to
>> >>> WEB-INF/classes when packaging a war file. I need the files in the
>> >>> base level of the war(and the property below references that
>> >>> correctly, BUT the directory doesn't exist yet).
>> >>>
>> >>> The only solution I am aware of for css, js, jpg fixes to go out in
>> >>> a new release is to rename the path to the file(or the file itself)
>> >>> as it is a very easy solution in build tools typically(at least it
>> was in ant).
>> >>>
>> >>> Dean
>> >>>
>> >>>
>> >>>
>> >>> On Wed, May 19, 2010 at 8:06 AM, Moll, Jeff<JM...@glhec.org> wrote:
>> >>>
>> >>>
>> >>>
>> >>>> The correct property for accessing the target directory is
>> >>>> ${project.build.outputDirectory}. So if you change in your "todir"
>> >>>> to use ${project.build.outputDirectory} that should work. I would
>> >>>> suggest investigating another approach though, there has to be a
>> >>>> simpler solution to resolve .css caching.
>> >>>>
>> >>>> Thanks
>> >>>>
>> >>>> -Jeff
>> >>>>
>> >>>> -----Original Message-----
>> >>>> From: dean.hiller@gmail.com [mailto:dean.hiller@gmail.com] On
>> >>>> Behalf Of Dean Hiller
>> >>>> Sent: Wednesday, May 19, 2010 8:53 AM
>> >>>> To: users@maven.apache.org
>> >>>> Subject: Re: how to move folder from res to res${BUILD_NUMBER} in
>> maven?
>> >>>>
>> >>>> Is there no way of doing the below? This is like the most typical
>> >>>> thing in web applications so the browser will get the newest css,
>> >>>> js, jpg files when a new release comes out.
>> >>>>
>> >>>> thanks,
>> >>>> Dean
>> >>>>
>> >>>> On Tue, May 18, 2010 at 3:28 PM, Dean Hiller<de...@alvazan.com>
>> wrote:
>> >>>>
>> >>>>
>> >>>>
>> >>>>> Our resource folder in webapps named res(which has images, js,
>> >>>>> css,
>> >>>>> etc) is renamed every release. This then makes it so when we fix
>> >>>>> a css, customers get the fresh one instead of the old stale one
>> >>>>> from their cache(ie. they get the fix we made since this folder is
>>
>> >>>>> always renamed).
>> >>>>>
>> >>>>> So, in maven, I had
>> >>>>> <plugin>
>> >>>>> <artifactId>maven-antrun-plugin</artifactId>
>> >>>>> <executions>
>> >>>>> <execution>
>> >>>>> <phase>test</phase>
>> >>>>> <goals>
>> >>>>> <goal>run</goal>
>> >>>>> </goals>
>> >>>>> <configuration>
>> >>>>> <tasks>
>> >>>>> <move
>> >>>>> file="${project.build.directory}/${
>> >>>>> project.name}-${project.version}/res"
>> >>>>>
>> >>>>> todir="${project.build.directory}/${
>> >>>>> project.name}-${project.version}/res${BUILD_NUMBER}" />
>> >>>>> <delete
>> >>>>>
>> >>>>> file="${project.build.directory}/${
>> >>>>> project.name}-${project.version}/WEB-INF/components.xml" />
>> >>>>> <copy
>> >>>>> file="src/main/descriptors/jboss/WEB-INF/components.xml"
>> >>>>>
>> >>>>> tofile="${project.build.directory}/${
>> >>>>> project.name}-${project.version}/WEB-INF/components.xml" />
>> >>>>> </tasks>
>> >>>>> </configuration>
>> >>>>> </execution>
>> >>>>> </executions>
>> >>>>> </plugin>
>> >>>>>
>> >>>>> but the staging area for the webapp in target directory seems not
>> >>>>> to exist when my ant tasks run :( and so our build keeps on
>> failing.
>> >>>>> 1. How do I move the target/webappstaging/res folder to
>> >>>>> target/webappstaging/resBUILDNUMBER folder OR 2. How do I move the
>>
>> >>>>> src/main/webapp/res folder to target/webappstaging/resBUILD_NUMBER
>> >>>>> folder and delete target/webappstaging/res folder
>> >>>>>
>> >>>>> thanks,
>> >>>>> Dean
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>
>> >>>>
>> >>>> -------------------------------------------------------------------
>> >>>> ------------- The information contained in this communication may
>> >>>> be confidential, is intended only for the use of the recipient(s)
>> >>>> named above, and may be legally privileged.
>> >>>> If the reader of this message is not the intended recipient, you
>> >>>> are hereby notified that any dissemination, distribution, or
>> >>>> copying of this communication, or any of its contents, is strictly
>> >>>> prohibited. If you have received this communication in error,
>> >>>> please notify the sender immediately and destroy or delete the
>> >>>> original message and any copy of it from your computer system.
>> >>>> If
>> >>>> you have any questions concerning this message, please contact the
>> >>>> sender.
>> >>>>
>> >>>>
>> >>>> ===================================================================
>> >>>> =============
>> >>>>
>> >>>>
>> >>>>
>> >>>> -------------------------------------------------------------------
>> >>>> -- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >>>> For additional commands, e-mail: users-help@maven.apache.org
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>
>> >>>
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: users-help@maven.apache.org
>> >>
>> >>
>> >
>>
>>
>> --------------------------------------------------------------------------------
>> The information contained in this communication may be confidential, is
>> intended
>> only for the use of the recipient(s) named above, and may be legally
>> privileged.
>> If the reader of this message is not the intended recipient, you are
>> hereby
>> notified that any dissemination, distribution, or copying of this
>> communication,
>> or any of its contents, is strictly prohibited. If you have received this
>> communication in error, please notify the sender immediately and destroy
>> or
>> delete the original message and any copy of it from your computer system.
>> If
>> you have any questions concerning this message, please contact the sender.
>>
>> ================================================================================
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
Re: should be an easy Filtering question?
Posted by Dean Hiller <de...@alvazan.com>.
My original example is based off that page below(the longer snippet of xml
below has it), and that is not working at all :(.
thanks,
Dean
On Wed, May 19, 2010 at 2:27 PM, Moll, Jeff <JM...@glhec.org> wrote:
> Try this page is you have not done so yet, this may be more helpful than
> the previous example I passed along assuming you are using the
> war-plug-in.
> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filteri
> ng-webresources.html<http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filteri%0Ang-webresources.html>
>
> -Jeff
>
> -----Original Message-----
> From: dean.hiller@gmail.com [mailto:dean.hiller@gmail.com] On Behalf Of
> Dean Hiller
> Sent: Wednesday, May 19, 2010 3:17 PM
> To: Maven Users List
> Subject: Re: should be an easy Filtering question?
>
> This question should be really easy....I would assume even novices would
> know the answer here?? Any takers....please!!!! I would really like to
> get this working.
>
> On Wed, May 19, 2010 at 11:46 AM, Dean Hiller <de...@alvazan.com> wrote:
>
> > I am missing just one more thing. The doc here
> > http://maven.apache.org/guides/getting-started/index.html#How_do_I_fil
> > ter_resource_files
> >
> > is about slipping in property files oddly enough not about filtering
> > out files(I just want to exclude one folder during the build). I see
> > the
> >
> > <filters>
> > <filter>some properties file for slipping in params</filter>
> > </filters>
> >
> > How do I add my exclusion of my res folder?
> >
> > I tried copying the example you gave into the build element and adding
>
> > excludes as well...
> >
> > <resources>
> > <resource>
> > <directory>src/main/webapp</directory>
> > <filtering>true</filtering>
> >
> > <excludes>
> > <exclude>**res**</exclude>
> > </excludes>
> >
> > </resource>
> > </resources>
> >
> > Still not working :(
> >
> > thanks,
> > Dean
> >
> >
> > On Wed, May 19, 2010 at 11:29 AM, Moll, Jeff <JM...@glhec.org> wrote:
> >
> >> Make sure you have the resource filtering turned on. By default it is
>
> >> not so you will need something like this:
> >>
> >> <build>
> >> <resources>
> >> <resource>
> >> <directory>src/main/resources</directory>
> >> <filtering>true</filtering>
> >> </resource>
> >> </resources>
> >> </build>
> >>
> >>
> >>
> >> -----Original Message-----
> >> From: dean.hiller@gmail.com [mailto:dean.hiller@gmail.com] On Behalf
> >> Of Dean Hiller
> >> Sent: Wednesday, May 19, 2010 12:03 PM
> >> To: Maven Users List
> >> Subject: Re: move folder from res to res${BUILD_NUMBER} easy
> >> Filtering problem...
> >>
> >> ok, so tried out my solution and the copy is working ;) but it is not
>
> >> filtering our the res folder in the war file plugin for some reason.
> >> How do I fix this xml so it filters out res folder...
> >>
> >> <execution>
> >> <phase>test</phase>
> >> <goals>
> >> <goal>run</goal>
> >> </goals>
> >> <configuration>
> >> <tasks>
> >> <echo message="Running jboss
> >> ant tasks"/>
> >> <mkdir
> >> dir="${project.build.directory}/${project.name
> >> }-${project.version}/res-${BUILD_NUMBER}"/>
> >> <copy
> >> todir="${project.build.directory}/${project.name
> >> }-${project.version}/res-${BUILD_NUMBER}">
> >> <fileset
> >> dir="src/main/webapp/res">
> >> <include name="**"/>
> >> </fileset>
> >> </copy>
> >> <copy
> >> file="src/main/descriptors/jboss/WEB-INF/components.xml"
> >>
> >> tofile="${project.build.directory}/${project.name}-${project.version}
> >> /WE
> >> B-INF/components.xml"
> >> />
> >> </tasks>
> >> </configuration>
> >> </execution>
> >> </executions>
> >> </plugin>
> >> <plugin>
> >> <groupId>org.apache.maven.plugins</groupId>
> >> <artifactId>maven-war-plugin</artifactId>
> >> <version>2.0</version>
> >> <configuration>
> >> <webResources>
> >> <resource>
> >> <!-- this is relative to the pom.xml
> >> directory
> >> -->
> >> <directory>src/main/webapp</directory>
> >> <!-- the list has a default value of **
> >> -->
> >> <excludes>
> >> <exclude>res**</exclude>
> >> </excludes>
> >> </resource>
> >> </webResources>
> >>
> >> <archive>
> >> <manifestEntries>
> >>
> >> <Svn-Revision>${SVN_REVISION}</Svn-Revision>
> >>
> >> <Build-Tag>${BUILD_TAG}</Build-Tag>
> >>
> >> <Build-Number>${BUILD_NUMBER}</Build-Number>
> >> <Build-Id>${BUILD_ID}</Build-Id>
> >> </manifestEntries>
> >> </archive>
> >> </configuration>
> >> </plugin>
> >>
> >> On Wed, May 19, 2010 at 8:53 AM, Dean Hiller <de...@alvazan.com>
> wrote:
> >>
> >> > heh, I went that direction and that hosed my dev environment up/SCM
>
> >> > such taht SCM wanted to check the changes in(I then figured it is
> >> > really a bad idea to generate files at all during a build in the
> >> > src or input directories).
> >> >
> >> > but as in my last email, I think I am close to a solution. Just
> >> > have to try it after we fix our artifactory from being filled up.
> >> >
> >> > Dean
> >> >
> >> >
> >> >
> >> > On Wed, May 19, 2010 at 8:49 AM, Ron Wheeler <
> >> > rwheeler@artifact-software.com> wrote:
> >> >
> >> >> Can you not figure out a way to rename the source of the copy so
> >> >> that
> >>
> >> >> the names are changed before maven moves them to the output?
> >> >>
> >> >> Ron
> >> >>
> >> >>
> >> >>
> >> >> On 19/05/2010 10:20 AM, Dean Hiller wrote:
> >> >>
> >> >>> actually, this pattern is very typical to release new versions of
>
> >> >>> css, js, etc. Projects like richfaces and TinyMCE both use this
> >> >>> pattern(not to mention many more). I don't know of any other way
>
> >> >>> to
> >>
> >> >>> get css, js fixes immediately out to customers without the
> >> >>> renaming(in fact, I doubt a better solution exists here as this
> >> >>> solution has worked great for our last 4 releases but I am open
> >> >>> to ideas).
> >> >>>
> >> >>> As far as ${project.build.outputDirectory}, I did try that but
> >> >>> that seems to deal with the target/classes directory which then
> >> >>> goes to WEB-INF/classes when packaging a war file. I need the
> >> >>> files in the base level of the war(and the property below
> >> >>> references that correctly, BUT the directory doesn't exist yet).
> >> >>>
> >> >>> The only solution I am aware of for css, js, jpg fixes to go out
> >> >>> in a new release is to rename the path to the file(or the file
> >> >>> itself) as it is a very easy solution in build tools typically(at
>
> >> >>> least it
> >> was in ant).
> >> >>>
> >> >>> Dean
> >> >>>
> >> >>>
> >> >>>
> >> >>> On Wed, May 19, 2010 at 8:06 AM, Moll, Jeff<JM...@glhec.org>
> wrote:
> >> >>>
> >> >>>
> >> >>>
> >> >>>> The correct property for accessing the target directory is
> >> >>>> ${project.build.outputDirectory}. So if you change in your
> "todir"
> >> >>>> to use ${project.build.outputDirectory} that should work. I
> >> >>>> would suggest investigating another approach though, there has
> >> >>>> to be a simpler solution to resolve .css caching.
> >> >>>>
> >> >>>> Thanks
> >> >>>>
> >> >>>> -Jeff
> >> >>>>
> >> >>>> -----Original Message-----
> >> >>>> From: dean.hiller@gmail.com [mailto:dean.hiller@gmail.com] On
> >> >>>> Behalf Of Dean Hiller
> >> >>>> Sent: Wednesday, May 19, 2010 8:53 AM
> >> >>>> To: users@maven.apache.org
> >> >>>> Subject: Re: how to move folder from res to res${BUILD_NUMBER}
> >> >>>> in
> >> maven?
> >> >>>>
> >> >>>> Is there no way of doing the below? This is like the most
> >> >>>> typical thing in web applications so the browser will get the
> >> >>>> newest css, js, jpg files when a new release comes out.
> >> >>>>
> >> >>>> thanks,
> >> >>>> Dean
> >> >>>>
> >> >>>> On Tue, May 18, 2010 at 3:28 PM, Dean Hiller<de...@alvazan.com>
> >> wrote:
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>>> Our resource folder in webapps named res(which has images, js,
> >> >>>>> css,
> >> >>>>> etc) is renamed every release. This then makes it so when we
> >> >>>>> fix a css, customers get the fresh one instead of the old stale
>
> >> >>>>> one from their cache(ie. they get the fix we made since this
> >> >>>>> folder is
> >>
> >> >>>>> always renamed).
> >> >>>>>
> >> >>>>> So, in maven, I had
> >> >>>>> <plugin>
> >> >>>>> <artifactId>maven-antrun-plugin</artifactId>
> >> >>>>> <executions>
> >> >>>>> <execution>
> >> >>>>> <phase>test</phase>
> >> >>>>> <goals>
> >> >>>>> <goal>run</goal>
> >> >>>>> </goals>
> >> >>>>> <configuration>
> >> >>>>> <tasks>
> >> >>>>> <move
> >> >>>>> file="${project.build.directory}/${
> >> >>>>> project.name}-${project.version}/res"
> >> >>>>>
> >> >>>>> todir="${project.build.directory}/${
> >> >>>>> project.name}-${project.version}/res${BUILD_NUMBER}" />
> >> >>>>> <delete
> >> >>>>>
> >> >>>>> file="${project.build.directory}/${
> >> >>>>> project.name}-${project.version}/WEB-INF/components.xml" />
> >> >>>>> <copy
> >> >>>>> file="src/main/descriptors/jboss/WEB-INF/components.xml"
> >> >>>>>
> >> >>>>> tofile="${project.build.directory}/${
> >> >>>>> project.name}-${project.version}/WEB-INF/components.xml" />
> >> >>>>> </tasks>
> >> >>>>> </configuration>
> >> >>>>> </execution>
> >> >>>>> </executions>
> >> >>>>> </plugin>
> >> >>>>>
> >> >>>>> but the staging area for the webapp in target directory seems
> >> >>>>> not to exist when my ant tasks run :( and so our build keeps on
> >> failing.
> >> >>>>> 1. How do I move the target/webappstaging/res folder to
> >> >>>>> target/webappstaging/resBUILDNUMBER folder OR 2. How do I move
> >> >>>>> the
> >>
> >> >>>>> src/main/webapp/res folder to
> >> >>>>> target/webappstaging/resBUILD_NUMBER
> >> >>>>> folder and delete target/webappstaging/res folder
> >> >>>>>
> >> >>>>> thanks,
> >> >>>>> Dean
> >> >>>>>
> >> >>>>>
> >> >>>>>
> >> >>>>>
> >> >>>>>
> >> >>>>>
> >> >>>>>
> >> >>>>>
> >> >>>>
> >> >>>>
> >> >>>> ----------------------------------------------------------------
> >> >>>> ---
> >> >>>> ------------- The information contained in this communication
> >> >>>> may be confidential, is intended only for the use of the
> >> >>>> recipient(s) named above, and may be legally privileged.
> >> >>>> If the reader of this message is not the intended recipient, you
>
> >> >>>> are hereby notified that any dissemination, distribution, or
> >> >>>> copying of this communication, or any of its contents, is
> >> >>>> strictly prohibited. If you have received this communication in
> >> >>>> error, please notify the sender immediately and destroy or
> >> >>>> delete the original message and any copy of it from your
> computer system.
> >> >>>> If
> >> >>>> you have any questions concerning this message, please contact
> >> >>>> the sender.
> >> >>>>
> >> >>>>
> >> >>>> ================================================================
> >> >>>> ===
> >> >>>> =============
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>> ----------------------------------------------------------------
> >> >>>> ---
> >> >>>> -- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> >>>> For additional commands, e-mail: users-help@maven.apache.org
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>
> >> >>>
> >> >>
> >> >>
> >> >> ------------------------------------------------------------------
> >> >> --- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> >> For additional commands, e-mail: users-help@maven.apache.org
> >> >>
> >> >>
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> ----------- The information contained in this communication may be
> >> confidential, is intended only for the use of the recipient(s) named
> >> above, and may be legally privileged.
> >> If the reader of this message is not the intended recipient, you are
> >> hereby notified that any dissemination, distribution, or copying of
> >> this communication, or any of its contents, is strictly prohibited.
> >> If you have received this communication in error, please notify the
> >> sender immediately and destroy or delete the original message and any
>
> >> copy of it from your computer system.
> >> If
> >> you have any questions concerning this message, please contact the
> sender.
> >>
> >> =====================================================================
> >> ===========
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
RE: should be an easy Filtering question?
Posted by "Moll, Jeff" <JM...@glhec.org>.
Try this page is you have not done so yet, this may be more helpful than
the previous example I passed along assuming you are using the
war-plug-in.
http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filteri
ng-webresources.html
-Jeff
-----Original Message-----
From: dean.hiller@gmail.com [mailto:dean.hiller@gmail.com] On Behalf Of
Dean Hiller
Sent: Wednesday, May 19, 2010 3:17 PM
To: Maven Users List
Subject: Re: should be an easy Filtering question?
This question should be really easy....I would assume even novices would
know the answer here?? Any takers....please!!!! I would really like to
get this working.
On Wed, May 19, 2010 at 11:46 AM, Dean Hiller <de...@alvazan.com> wrote:
> I am missing just one more thing. The doc here
> http://maven.apache.org/guides/getting-started/index.html#How_do_I_fil
> ter_resource_files
>
> is about slipping in property files oddly enough not about filtering
> out files(I just want to exclude one folder during the build). I see
> the
>
> <filters>
> <filter>some properties file for slipping in params</filter>
> </filters>
>
> How do I add my exclusion of my res folder?
>
> I tried copying the example you gave into the build element and adding
> excludes as well...
>
> <resources>
> <resource>
> <directory>src/main/webapp</directory>
> <filtering>true</filtering>
>
> <excludes>
> <exclude>**res**</exclude>
> </excludes>
>
> </resource>
> </resources>
>
> Still not working :(
>
> thanks,
> Dean
>
>
> On Wed, May 19, 2010 at 11:29 AM, Moll, Jeff <JM...@glhec.org> wrote:
>
>> Make sure you have the resource filtering turned on. By default it is
>> not so you will need something like this:
>>
>> <build>
>> <resources>
>> <resource>
>> <directory>src/main/resources</directory>
>> <filtering>true</filtering>
>> </resource>
>> </resources>
>> </build>
>>
>>
>>
>> -----Original Message-----
>> From: dean.hiller@gmail.com [mailto:dean.hiller@gmail.com] On Behalf
>> Of Dean Hiller
>> Sent: Wednesday, May 19, 2010 12:03 PM
>> To: Maven Users List
>> Subject: Re: move folder from res to res${BUILD_NUMBER} easy
>> Filtering problem...
>>
>> ok, so tried out my solution and the copy is working ;) but it is not
>> filtering our the res folder in the war file plugin for some reason.
>> How do I fix this xml so it filters out res folder...
>>
>> <execution>
>> <phase>test</phase>
>> <goals>
>> <goal>run</goal>
>> </goals>
>> <configuration>
>> <tasks>
>> <echo message="Running jboss
>> ant tasks"/>
>> <mkdir
>> dir="${project.build.directory}/${project.name
>> }-${project.version}/res-${BUILD_NUMBER}"/>
>> <copy
>> todir="${project.build.directory}/${project.name
>> }-${project.version}/res-${BUILD_NUMBER}">
>> <fileset
>> dir="src/main/webapp/res">
>> <include name="**"/>
>> </fileset>
>> </copy>
>> <copy
>> file="src/main/descriptors/jboss/WEB-INF/components.xml"
>>
>> tofile="${project.build.directory}/${project.name}-${project.version}
>> /WE
>> B-INF/components.xml"
>> />
>> </tasks>
>> </configuration>
>> </execution>
>> </executions>
>> </plugin>
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-war-plugin</artifactId>
>> <version>2.0</version>
>> <configuration>
>> <webResources>
>> <resource>
>> <!-- this is relative to the pom.xml
>> directory
>> -->
>> <directory>src/main/webapp</directory>
>> <!-- the list has a default value of **
>> -->
>> <excludes>
>> <exclude>res**</exclude>
>> </excludes>
>> </resource>
>> </webResources>
>>
>> <archive>
>> <manifestEntries>
>>
>> <Svn-Revision>${SVN_REVISION}</Svn-Revision>
>>
>> <Build-Tag>${BUILD_TAG}</Build-Tag>
>>
>> <Build-Number>${BUILD_NUMBER}</Build-Number>
>> <Build-Id>${BUILD_ID}</Build-Id>
>> </manifestEntries>
>> </archive>
>> </configuration>
>> </plugin>
>>
>> On Wed, May 19, 2010 at 8:53 AM, Dean Hiller <de...@alvazan.com>
wrote:
>>
>> > heh, I went that direction and that hosed my dev environment up/SCM
>> > such taht SCM wanted to check the changes in(I then figured it is
>> > really a bad idea to generate files at all during a build in the
>> > src or input directories).
>> >
>> > but as in my last email, I think I am close to a solution. Just
>> > have to try it after we fix our artifactory from being filled up.
>> >
>> > Dean
>> >
>> >
>> >
>> > On Wed, May 19, 2010 at 8:49 AM, Ron Wheeler <
>> > rwheeler@artifact-software.com> wrote:
>> >
>> >> Can you not figure out a way to rename the source of the copy so
>> >> that
>>
>> >> the names are changed before maven moves them to the output?
>> >>
>> >> Ron
>> >>
>> >>
>> >>
>> >> On 19/05/2010 10:20 AM, Dean Hiller wrote:
>> >>
>> >>> actually, this pattern is very typical to release new versions of
>> >>> css, js, etc. Projects like richfaces and TinyMCE both use this
>> >>> pattern(not to mention many more). I don't know of any other way
>> >>> to
>>
>> >>> get css, js fixes immediately out to customers without the
>> >>> renaming(in fact, I doubt a better solution exists here as this
>> >>> solution has worked great for our last 4 releases but I am open
>> >>> to ideas).
>> >>>
>> >>> As far as ${project.build.outputDirectory}, I did try that but
>> >>> that seems to deal with the target/classes directory which then
>> >>> goes to WEB-INF/classes when packaging a war file. I need the
>> >>> files in the base level of the war(and the property below
>> >>> references that correctly, BUT the directory doesn't exist yet).
>> >>>
>> >>> The only solution I am aware of for css, js, jpg fixes to go out
>> >>> in a new release is to rename the path to the file(or the file
>> >>> itself) as it is a very easy solution in build tools typically(at
>> >>> least it
>> was in ant).
>> >>>
>> >>> Dean
>> >>>
>> >>>
>> >>>
>> >>> On Wed, May 19, 2010 at 8:06 AM, Moll, Jeff<JM...@glhec.org>
wrote:
>> >>>
>> >>>
>> >>>
>> >>>> The correct property for accessing the target directory is
>> >>>> ${project.build.outputDirectory}. So if you change in your
"todir"
>> >>>> to use ${project.build.outputDirectory} that should work. I
>> >>>> would suggest investigating another approach though, there has
>> >>>> to be a simpler solution to resolve .css caching.
>> >>>>
>> >>>> Thanks
>> >>>>
>> >>>> -Jeff
>> >>>>
>> >>>> -----Original Message-----
>> >>>> From: dean.hiller@gmail.com [mailto:dean.hiller@gmail.com] On
>> >>>> Behalf Of Dean Hiller
>> >>>> Sent: Wednesday, May 19, 2010 8:53 AM
>> >>>> To: users@maven.apache.org
>> >>>> Subject: Re: how to move folder from res to res${BUILD_NUMBER}
>> >>>> in
>> maven?
>> >>>>
>> >>>> Is there no way of doing the below? This is like the most
>> >>>> typical thing in web applications so the browser will get the
>> >>>> newest css, js, jpg files when a new release comes out.
>> >>>>
>> >>>> thanks,
>> >>>> Dean
>> >>>>
>> >>>> On Tue, May 18, 2010 at 3:28 PM, Dean Hiller<de...@alvazan.com>
>> wrote:
>> >>>>
>> >>>>
>> >>>>
>> >>>>> Our resource folder in webapps named res(which has images, js,
>> >>>>> css,
>> >>>>> etc) is renamed every release. This then makes it so when we
>> >>>>> fix a css, customers get the fresh one instead of the old stale
>> >>>>> one from their cache(ie. they get the fix we made since this
>> >>>>> folder is
>>
>> >>>>> always renamed).
>> >>>>>
>> >>>>> So, in maven, I had
>> >>>>> <plugin>
>> >>>>> <artifactId>maven-antrun-plugin</artifactId>
>> >>>>> <executions>
>> >>>>> <execution>
>> >>>>> <phase>test</phase>
>> >>>>> <goals>
>> >>>>> <goal>run</goal>
>> >>>>> </goals>
>> >>>>> <configuration>
>> >>>>> <tasks>
>> >>>>> <move
>> >>>>> file="${project.build.directory}/${
>> >>>>> project.name}-${project.version}/res"
>> >>>>>
>> >>>>> todir="${project.build.directory}/${
>> >>>>> project.name}-${project.version}/res${BUILD_NUMBER}" />
>> >>>>> <delete
>> >>>>>
>> >>>>> file="${project.build.directory}/${
>> >>>>> project.name}-${project.version}/WEB-INF/components.xml" />
>> >>>>> <copy
>> >>>>> file="src/main/descriptors/jboss/WEB-INF/components.xml"
>> >>>>>
>> >>>>> tofile="${project.build.directory}/${
>> >>>>> project.name}-${project.version}/WEB-INF/components.xml" />
>> >>>>> </tasks>
>> >>>>> </configuration>
>> >>>>> </execution>
>> >>>>> </executions>
>> >>>>> </plugin>
>> >>>>>
>> >>>>> but the staging area for the webapp in target directory seems
>> >>>>> not to exist when my ant tasks run :( and so our build keeps on
>> failing.
>> >>>>> 1. How do I move the target/webappstaging/res folder to
>> >>>>> target/webappstaging/resBUILDNUMBER folder OR 2. How do I move
>> >>>>> the
>>
>> >>>>> src/main/webapp/res folder to
>> >>>>> target/webappstaging/resBUILD_NUMBER
>> >>>>> folder and delete target/webappstaging/res folder
>> >>>>>
>> >>>>> thanks,
>> >>>>> Dean
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>
>> >>>>
>> >>>> ----------------------------------------------------------------
>> >>>> ---
>> >>>> ------------- The information contained in this communication
>> >>>> may be confidential, is intended only for the use of the
>> >>>> recipient(s) named above, and may be legally privileged.
>> >>>> If the reader of this message is not the intended recipient, you
>> >>>> are hereby notified that any dissemination, distribution, or
>> >>>> copying of this communication, or any of its contents, is
>> >>>> strictly prohibited. If you have received this communication in
>> >>>> error, please notify the sender immediately and destroy or
>> >>>> delete the original message and any copy of it from your
computer system.
>> >>>> If
>> >>>> you have any questions concerning this message, please contact
>> >>>> the sender.
>> >>>>
>> >>>>
>> >>>> ================================================================
>> >>>> ===
>> >>>> =============
>> >>>>
>> >>>>
>> >>>>
>> >>>> ----------------------------------------------------------------
>> >>>> ---
>> >>>> -- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >>>> For additional commands, e-mail: users-help@maven.apache.org
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>
>> >>>
>> >>
>> >>
>> >> ------------------------------------------------------------------
>> >> --- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: users-help@maven.apache.org
>> >>
>> >>
>> >
>>
>>
>> ---------------------------------------------------------------------
>> ----------- The information contained in this communication may be
>> confidential, is intended only for the use of the recipient(s) named
>> above, and may be legally privileged.
>> If the reader of this message is not the intended recipient, you are
>> hereby notified that any dissemination, distribution, or copying of
>> this communication, or any of its contents, is strictly prohibited.
>> If you have received this communication in error, please notify the
>> sender immediately and destroy or delete the original message and any
>> copy of it from your computer system.
>> If
>> you have any questions concerning this message, please contact the
sender.
>>
>> =====================================================================
>> ===========
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org