On Wed, May 22, 2013 at 2:39 AM, Baptiste MATHUS <m...@batmat.net> wrote:

> Hi,
> From the usage page, though not perfectly thoroughly definitely clearly
> stated ;) and.from my understanding it's said only this property is to go
> in this file.
>
> Actually, this plugin is more designed to create dynamic properties and
> make them available in the build context. Then you can reuse those
> variables as input params for other plugins (e.g. dedicated line in the
> manifest) or to filter properties in files (src/main/resources or even
> source code with the templating-maven-plugin).
>
> So, back to the initial point: where do you actually want to use those
> properties? Somewhere in the artifact?
>

In the immortal word of Homer Simpson, "D'oh!" I got it: The ${buildNumber}
property is now defined so I can add it to my META-INF/MANIFEST.MF with the
jar or war plugin. That's excellent, and much easier than the old way we
did it with Ant. Thank you.

BTW, the link "on how to version your projects with this
plugin<http://apollo.ucalgary.ca/tlcprojectswiki/index.php/Public/Project_Versioning_-_Best_Practices#Build_Versioning>"
is broken, but reading MANIFEST.MF is simple (and numerous examples can be
found via Google).


>
> Cheers
> Le 20 mai 2013 19:15, "Thad Humphries" <thad.humphr...@gmail.com> a écrit
> :
>
> > On Mon, May 20, 2013 at 11:56 AM, Baptiste MATHUS <m...@batmat.net> wrote:
> >
> > > Hi,
> > > Could you provide:
> > > - the format you tried,
> > > - what you were expecting
> > > - what it gives
> > > - buildnumber plugin version you're using
> > > - Maven version
> > >
> > > Cheers
> > >
> >
> > I tried
> >
> >       <plugin>
> >         <groupId>org.codehaus.mojo</groupId>
> >         <artifactId>buildnumber-maven-plugin</artifactId>
> >         <version>1.2</version>
> >         <executions>
> >           <execution>
> >             <phase>validate</phase>
> >             <goals>
> >               <goal>create</goal>
> >             </goals>
> >           </execution>
> >         </executions>
> >         <configuration>
> >           <doCheck>false</doCheck>
> >           <doUpdate>false</doUpdate>
> >           <revisionOnScmFailure>n/a</revisionOnScmFailure>
> >           <format>{0,date,yyyy-MM-dd}_{1,number} ({2})</format>
> >           <items>
> >             <item>timestamp</item>
> >             <item>buildNumber</item>
> >             <item>${user.name}</item>
> >           </items>
> >         </configuration>
> >       </plugin>
> >
> > I was expecting ${basedir}/buildNumber.properties to contain a property
> > with the string
> >
> >       2013-05-20_12 (thad)
> >
> > as well as the buildNumber property.
> >
> > What I get is the buildNumber property
> >
> >       #maven.buildNumber.plugin properties file
> >       #Mon May 20 12:57:02 EDT 2013
> >       buildNumber=12
> >
> > but no other property. I can see in my console
> >
> > [INFO] --- buildnumber-maven-plugin:1.2:create (default) @ Tools ---
> > [INFO] Storing buildNumber: 2013-05-20_12 (thad) at timestamp:
> > 1369069022984
> > [INFO] Executing: /bin/sh -c cd /home/thad/devel/tools && svn
> > --non-interactive info
> > [INFO] Working directory: /home/thad/devel/tools
> > [INFO] Storing buildScmBranch: UNKNOWN_BRANCH
> >
> > but that formatted string is not written anywhere. I'd like to have it
> > somewhere--eventually in my target--so that my webapp can find it as a
> > ResourceBundle (like www for testing, and
> > MyApp-1.0-SNAPSHOT/WEB-INF/classes for the WAR).
> >
> > Maybe I'm misunderstand what this plugin can do. I don't see the point in
> > having my formatted string solely in my console. (I'm *very new* to
> Maven;
> > I'm trying to create build string similar to other apps we use in our
> > webapps.)
> >
> > As you see from the above, I'm using version 1.2 of the plugin.
> >
> > My Maven version is 3.0.5
> >
> > BTW, I've also added this to my pom.xml (since my source is not yet
> checked
> > in to our local SVN repository).
> >
> >   <scm>
> >     <connection>scm:svn:http://127.0.0.1/dummy</connection>
> >     <developerConnection>scm:svn:https://127.0.0.1/dummy
> > </developerConnection>
> >     <tag>HEAD</tag>
> >     <url>http://127.0.0.1/dummy</url>
> >   </scm>
> >
> >
> > Thank you.
> >
> >
> > > Le 20 mai 2013 02:19, "Thad Humphries" <thad.humphr...@gmail.com> a
> > écrit
> > > :
> > >
> > > > I'm attempting to use the buildnumber-maven-plugin (
> > > > http://mojo.codehaus.org/buildnumber-maven-plugin/<
> > > > http://mojo.codehaus.org/buildnumber-maven-plugin/usage.html>)
> > > > to give me a build based on a number that will increment when create
> my
> > > WAR
> > > > file.
> > > >
> > > > Although I define a <format> and <items> as shown in the usage page,
> > all
> > > > that shows up in buildNumber.properties is buildNumber=10
> > > >
> > > > Is this to be expected? How can I get a formatted string? (Otherwise
> I
> > > have
> > > > to use antrun to get at timestamp).
> > > >
> > > > --
> > > > "Hell hath no limits, nor is circumscrib'd In one self-place; but
> where
> > > we
> > > > are is hell, And where hell is, there must we ever be" --Christopher
> > > > Marlowe, *Doctor Faustus* (v, 121-24)
> > > >
> > >
> >
> >
> >
> > --
> > "Hell hath no limits, nor is circumscrib'd In one self-place; but where
> we
> > are is hell, And where hell is, there must we ever be" --Christopher
> > Marlowe, *Doctor Faustus* (v, 121-24)
> >
>



-- 
"Hell hath no limits, nor is circumscrib'd In one self-place; but where we
are is hell, And where hell is, there must we ever be" --Christopher
Marlowe, *Doctor Faustus* (v, 121-24)

Reply via email to