I always rejig my resources folders so that I have

src/main/resources/filtered
src/main/resources/verbatim
src/test/resources/filtered
src/test/resources/verbatim

If only I could come up with a good version for webapps

2008/11/20 Brian E. Fox <[EMAIL PROTECTED]>

> No you can't filter only one file that I recall, but you can make
> something like src/main/filtered-resources and enable filtering on that
> folder only.
>
> -----Original Message-----
> From: Raffaele [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 20, 2008 10:00 AM
> To: users@maven.apache.org
> Subject: Re: Project versioning
>
>
> Ok guys thank you all,
>
> There is only one thing that I'm continuing to not understand....
> In my src/main/resources I have many many files.....
> I would like to filter only one of those files....
> but putting this in my pom
>
> <resources>
>        <resource>
>                <directory>src/main/resources</directory>
>               <filtering>true</filtering>
>        </resource>
> </resources>
>
> has effect to try to filter all the files....
> How could I say maven to filter only one specific file and not a full
> folder?
>
> Best regards
> Raffaele
>
>
> Stephen Connolly-2 wrote:
> >
> > Alternatively, you could pull the version info from the pom.xml that
> gets
> > stashed in a sub-folder of META-INF by default.... but this might
> require
> > a
> > bit of work since the version could have been inherited from the
> parent
> > version...
> >
> > Safest way is as Brian suggests... and it has the added advantage of
> not
> > tieing you to maven for your build.
> >
> > What we do is we have a properties file with
> >
> > version=${project.version}
> >
> > as the only entry.  We then turn on filtering for that properties
> file,
> > and
> > to access it from code we just use getClass().getResource("/path to
> > versions.properties")
> >
> > 2008/11/20 Brian E. Fox <[EMAIL PROTECTED]>
> >
> >> Normally you just have a properties file that is filtered during the
> >> build and at runtime your code reads the value.
> >>
> >> -----Original Message-----
> >> From: Raffaele [mailto:[EMAIL PROTECTED]
> >> Sent: Thursday, November 20, 2008 8:53 AM
> >> To: users@maven.apache.org
> >> Subject: Project versioning
> >>
> >>
> >> Hi all,
> >>
> >> I would like some advices about how automatically update a properties
> >> file
> >> inserting into an incremental value representing the build number....
> >>
> >> My scenario:
> >> - I have a web application and I would like to insert in some page,
> the
> >> build version....
> >> - I would like to know if is there a way to obtain the project
> version
> >> from
> >> the java code in a way that I'm able to insert a label showing that
> >> version...
> >> - If there wasn't such a way, I was thinking to write project version
> in
> >> a
> >> file, then from java code I would read that file and would update my
> >> label...
> >>
> >> Have you got any idea? Obviously I would like to take advantage of
> Maven
> >> and
> >> I would prefer to avoid another file....
> >>
> >> Thanks in advance,
> >> Raffaele Gambelli
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Project-versioning-tp20601486p20601486.html
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Project-versioning-tp20601486p20603012.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to