I am trying to read the Jenkins number using a maven pom.xml using the following code. The issue is that, the build is failing with the error as I have specified below. I referred to the official document given by Jenkins Building a software project. If I try to use any text instead of ${BUILD_NUMBER} it is getting printed in the console but not the variable. 
POM Profile reference:
<profiles>
    <profile>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
            <build.number>${BUILD_NUMBER}</build.number>
        </properties>
    </profile>
</profiles>
POM System Property:
<systemPropertyVariables>
    <buildnumber>${build.number}</buildnumber>
</systemPropertyVariables>
Please let me know if I am doing something wrong.