maven buildnumber plugin issues

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

maven buildnumber plugin issues

Gourab Dash
Hello folks,
i m getting error using this plugin.

[ERROR] Failed to execute goal org.codehaus.mojo:buildnumber-maven-plugin:1.0-beta-4:create (default) on project : Execution default of goal org.codehaus.mojo:buildnumber-maven-plugin:1.0-beta-4:create failed: The scm url cannot be null. -> [Help 1]


i m nt using scm in pom.xml and using svn plugin from jenkins.



the plugin is as follows
 <plugin>
     <groupId>org.codehaus.mojo</groupId>
     <artifactId>buildnumber-maven-plugin</artifactId>
     <version>1.0-beta-4</version>
     <executions>
      <execution>
       <phase>validate</phase>
       <goals>
        <goal>create</goal>
       </goals>
      </execution>
     </executions>
     <configuration>
      <doCheck>false</doCheck>
      <doUpdate>false</doUpdate>
      <revisionOnScmFailure>true</revisionOnScmFailure>
        <format>${version}.{0,number}</format>
      <items>
       <item>buildNumber</item>
      </items>
     </configuration>
   </plugin>










However if i use the below plugin,it gets successful.but i m nt able to get the timestamp printed on the buildNumber.properties.
the plugin as below

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>buildnumber-maven-plugin</artifactId>
    <version>1.0-beta-3</version>
 <configuration>
      <buildNumberPropertyName>buildNumber.value</buildNumberPropertyName>
      <timestampPropertyName>buildNumber.timestamp</timestampPropertyName>

        <format>{0,number}</format>

           <items>
            <item>buildNumber</item>
        <item>timestamp</item>
      </items>
    </configuration>

 <executions>
      <execution>
        <phase>validate</phase>
        <goals>
          <goal>create</goal>
        </goals>
      </execution>
    </executions>
  </plugin>






please suggest some  ideas/ ways to get it done.




Reply | Threaded
Open this post in threaded view
|

Re: maven buildnumber plugin issues

Baptiste Mathus-5
Hi,

Could you please first remind us what you're trying to do?
Where would you like to ideally include that buildnumber? 

For example, having a line in the MANIFEST with the current svn revision? Something else?

Cheers


2013/8/1 Gourab Dash <[hidden email]>
Hello folks,
i m getting error using this plugin.

[ERROR] Failed to execute goal org.codehaus.mojo:buildnumber-maven-plugin:1.0-beta-4:create (default) on project : Execution default of goal org.codehaus.mojo:buildnumber-maven-plugin:1.0-beta-4:create failed: The scm url cannot be null. -> [Help 1]


i m nt using scm in pom.xml and using svn plugin from jenkins.



the plugin is as follows
 <plugin>
     <groupId>org.codehaus.mojo</groupId>
     <artifactId>buildnumber-maven-plugin</artifactId>
     <version>1.0-beta-4</version>
     <executions>
      <execution>
       <phase>validate</phase>
       <goals>
        <goal>create</goal>
       </goals>
      </execution>
     </executions>
     <configuration>
      <doCheck>false</doCheck>
      <doUpdate>false</doUpdate>
      <revisionOnScmFailure>true</revisionOnScmFailure>
        <format>${version}.{0,number}</format>
      <items>
       <item>buildNumber</item>
      </items>
     </configuration>
   </plugin>










However if i use the below plugin,it gets successful.but i m nt able to get the timestamp printed on the buildNumber.properties.
the plugin as below

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>buildnumber-maven-plugin</artifactId>
    <version>1.0-beta-3</version>
 <configuration>
      <buildNumberPropertyName>buildNumber.value</buildNumberPropertyName>
      <timestampPropertyName>buildNumber.timestamp</timestampPropertyName>

        <format>{0,number}</format>

           <items>
            <item>buildNumber</item>
        <item>timestamp</item>
      </items>
    </configuration>

 <executions>
      <execution>
        <phase>validate</phase>
        <goals>
          <goal>create</goal>
        </goals>
      </execution>
    </executions>
  </plugin>






please suggest some  ideas/ ways to get it done.





Reply | Threaded
Open this post in threaded view
|

Re: maven buildnumber plugin issues

Gourab Dash
Hi B.M

I want to print the build number as well as the build time-stamp printed on the file which gets generated as buildNumber.properties inside Workspace.
it would be nice if i can add some more info like svn url  as well




On Fri, Aug 2, 2013 at 12:14 PM, Baptiste Mathus <[hidden email]> wrote:
Hi,

Could you please first remind us what you're trying to do?
Where would you like to ideally include that buildnumber? 

For example, having a line in the MANIFEST with the current svn revision? Something else?

Cheers


2013/8/1 Gourab Dash <[hidden email]>
Hello folks,
i m getting error using this plugin.

[ERROR] Failed to execute goal org.codehaus.mojo:buildnumber-maven-plugin:1.0-beta-4:create (default) on project : Execution default of goal org.codehaus.mojo:buildnumber-maven-plugin:1.0-beta-4:create failed: The scm url cannot be null. -> [Help 1]


i m nt using scm in pom.xml and using svn plugin from jenkins.



the plugin is as follows
 <plugin>
     <groupId>org.codehaus.mojo</groupId>
     <artifactId>buildnumber-maven-plugin</artifactId>
     <version>1.0-beta-4</version>
     <executions>
      <execution>
       <phase>validate</phase>
       <goals>
        <goal>create</goal>
       </goals>
      </execution>
     </executions>
     <configuration>
      <doCheck>false</doCheck>
      <doUpdate>false</doUpdate>
      <revisionOnScmFailure>true</revisionOnScmFailure>
        <format>${version}.{0,number}</format>
      <items>
       <item>buildNumber</item>
      </items>
     </configuration>
   </plugin>










However if i use the below plugin,it gets successful.but i m nt able to get the timestamp printed on the buildNumber.properties.
the plugin as below

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>buildnumber-maven-plugin</artifactId>
    <version>1.0-beta-3</version>
 <configuration>
      <buildNumberPropertyName>buildNumber.value</buildNumberPropertyName>
      <timestampPropertyName>buildNumber.timestamp</timestampPropertyName>

        <format>{0,number}</format>

           <items>
            <item>buildNumber</item>
        <item>timestamp</item>
      </items>
    </configuration>

 <executions>
      <execution>
        <phase>validate</phase>
        <goals>
          <goal>create</goal>
        </goals>
      </execution>
    </executions>
  </plugin>






please suggest some  ideas/ ways to get it done.






Reply | Threaded
Open this post in threaded view
|

Re: maven buildnumber plugin issues

Baptiste MATHUS-3
Hi,


Generating the file in the workspace is generally not what you want for many reasons.

First you should know that file isn't designed to be used in the common use case. We for example use buildnumber-m-p but never used that file.
As this file sits in the source directories (and not the target one), this is not great :-). 

As I already explained in the other thread, buildnumber is designed to create dynamic properties. You generally want to reuse that properties to inflate them into the file you want in the produced/build directory.

If you want to create that kind of properties file, just create the file under src/main/resources for example and put ${yourVariable} inside (having enabled filtering, sure). 

HTH

Cheers
 


2013/8/2 Gourab Dash <[hidden email]>
Hi B.M

I want to print the build number as well as the build time-stamp printed on the file which gets generated as buildNumber.properties inside Workspace.
it would be nice if i can add some more info like svn url  as well




On Fri, Aug 2, 2013 at 12:14 PM, Baptiste Mathus <[hidden email]> wrote:
Hi,

Could you please first remind us what you're trying to do?
Where would you like to ideally include that buildnumber? 

For example, having a line in the MANIFEST with the current svn revision? Something else?

Cheers


2013/8/1 Gourab Dash <[hidden email]>
Hello folks,
i m getting error using this plugin.

[ERROR] Failed to execute goal org.codehaus.mojo:buildnumber-maven-plugin:1.0-beta-4:create (default) on project : Execution default of goal org.codehaus.mojo:buildnumber-maven-plugin:1.0-beta-4:create failed: The scm url cannot be null. -> [Help 1]


i m nt using scm in pom.xml and using svn plugin from jenkins.



the plugin is as follows
 <plugin>
     <groupId>org.codehaus.mojo</groupId>
     <artifactId>buildnumber-maven-plugin</artifactId>
     <version>1.0-beta-4</version>
     <executions>
      <execution>
       <phase>validate</phase>
       <goals>
        <goal>create</goal>
       </goals>
      </execution>
     </executions>
     <configuration>
      <doCheck>false</doCheck>
      <doUpdate>false</doUpdate>
      <revisionOnScmFailure>true</revisionOnScmFailure>
        <format>${version}.{0,number}</format>
      <items>
       <item>buildNumber</item>
      </items>
     </configuration>
   </plugin>










However if i use the below plugin,it gets successful.but i m nt able to get the timestamp printed on the buildNumber.properties.
the plugin as below

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>buildnumber-maven-plugin</artifactId>
    <version>1.0-beta-3</version>
 <configuration>
      <buildNumberPropertyName>buildNumber.value</buildNumberPropertyName>
      <timestampPropertyName>buildNumber.timestamp</timestampPropertyName>

        <format>{0,number}</format>

           <items>
            <item>buildNumber</item>
        <item>timestamp</item>
      </items>
    </configuration>

 <executions>
      <execution>
        <phase>validate</phase>
        <goals>
          <goal>create</goal>
        </goals>
      </execution>
    </executions>
  </plugin>






please suggest some  ideas/ ways to get it done.









--
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !