# BuildNumber for modules

**URL:** <https://forum.inductiveautomation.com/t/buildnumber-for-modules/10855>\
**Category:** 3rd Party Modules\
**Created:** [December 2, 2015, 10:43am UTC](https://forum.inductiveautomation.com/t/buildnumber-for-modules/10855 "2015-12-02T10:43:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amarth](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarth/32/3313_2.png) [@Amarth](https://forum.inductiveautomation.com/u/Amarth)\
**Post date:** [December 2, 2015, 10:43am UTC](https://forum.inductiveautomation.com/t/buildnumber-for-modules/10855/1 "2015-12-02T10:43:29Z")

</div>

Hello all.

I’m trying to set automatically a build number for a module i’m writing but I can’t find where to define it.

I’m using IntelliJ 15.0 and here are some code extracts to show the properties I used :

Main POM.xml

```auto
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
        <buildNumber>${maven.build.timestamp}</buildNumber>
    </properties>
```

Build POM.xml (in section)

```auto
 <moduleDescription>A module to communicate with CarteWeb. Build : ${maven.build.timestamp}</moduleDescription>
```

After packaging and installing the module, i got this :  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/ba0ede9bff8d16f027517502b0f1be5795f7df2b.png)

What I would like to do is setting the buildNumber in the “Version” row (b0) instead of in the “Description” row. It is surely possible but how to proceed ?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 2, 2015, 1:54pm UTC](https://forum.inductiveautomation.com/t/buildnumber-for-modules/10855/2 "2015-12-02T13:54:45Z")

</div>

Ignition uses the fourth component of the version number as the build number. So version 1.2.3.456789 in module.xml will become Version 1.2.3 (b456789) in the gateway. It hits an internal limit around 10 digits (32bit?) – you can’t use a high resolution timestamp.

---

<div class="post-metadata">

**Author:** ![Amarth](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarth/32/3313_2.png) [@Amarth](https://forum.inductiveautomation.com/u/Amarth)\
**Post date:** [December 2, 2015, 2:45pm UTC](https://forum.inductiveautomation.com/t/buildnumber-for-modules/10855/3 "2015-12-02T14:45:31Z")

</div>

Ok. Thank you for the reply.

It works when I use a static version (for example 1.0.0.17) but when I try to package with a dynamic version (1.0.0.${maven.build.timestamp}), I got warnings and errors telling me that “‘version’ contains an expression but should be a constant”.

Is it possible to use a dynamic build number ?

---

<div class="post-metadata">

**Author:** ![mgross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mgross/32/3311_2.png) [@mgross](https://forum.inductiveautomation.com/u/mgross)\
**Post date:** [December 2, 2015, 3:35pm UTC](https://forum.inductiveautomation.com/t/buildnumber-for-modules/10855/4 "2015-12-02T15:35:34Z")

</div>

You need to use the maven.build.timestamp variable directly, instead of trying to reference it from another variable. For example:

```auto
    <properties>
        <maven.build.timestamp.format>yyyyMMddHH</maven.build.timestamp.format>
    </properties>
..........
<configuration>
    <archive>
        <manifestEntries>
            <X-Ignition-Build-Date>${maven.build.timestamp}</X-Ignition-Build-Date>
        </manifestEntries>
    </archive>
</configuration>
```

---

<div class="post-metadata">

**Author:** ![Amarth](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarth/32/3313_2.png) [@Amarth](https://forum.inductiveautomation.com/u/Amarth)\
**Post date:** [December 3, 2015, 1:37pm UTC](https://forum.inductiveautomation.com/t/buildnumber-for-modules/10855/5 "2015-12-03T13:37:02Z")

</div>

Thank you for the reply.

Is your code supposed to be in the same POM file ? I can’t make it work, wherever I may add these lines. My build number stays set to 0.

![:scratch:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/76d1620bec252bfac07050c889ff5a91dc8a9c25.gif ":scratch:")

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [December 3, 2015, 1:40pm UTC](https://forum.inductiveautomation.com/t/buildnumber-for-modules/10855/6 "2015-12-03T13:40:10Z")

</div>

In your build pom.xml, modify the value of the moduleVersion element in when configuring ignition-maven-plugin.

---

<div class="post-metadata">

**Author:** ![Amarth](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarth/32/3313_2.png) [@Amarth](https://forum.inductiveautomation.com/u/Amarth)\
**Post date:** [December 3, 2015, 1:45pm UTC](https://forum.inductiveautomation.com/t/buildnumber-for-modules/10855/7 "2015-12-03T13:45:32Z")

</div>

It works !

Thank you.
