maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thad Humphries <thad.humphr...@gmail.com>
Subject Re: buildnumber-maven-plugin format
Date Mon, 20 May 2013 17:15:02 GMT
On Mon, May 20, 2013 at 11:56 AM, Baptiste MATHUS <ml@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.humphries@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)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message