I'm using the maven build plugin with the following configuration:

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <timestampFormat>
                        {0,date,yyyy-MM-dd HH:mm}
                    </timestampFormat>
                    <doCheck>false</doCheck>
                    <doUpdate>false</doUpdate>
                    <revisionOnScmFailure>0</revisionOnScmFailure>
                </configuration>
            </plugin>

and then I use the version number in

release-version=${project.version}-Revision:${buildNumber}-Branch:${scmBranch}-Date:${timestamp}

format. It is working perfectly if I build it on my PC, but it does not access the revision number when building it on Bamboo. I think Bamboo is using it's own SVN client to get the revision number, but I don not understand why it can not pass it to the release-version property. Thanks Zoltan

有帮助吗?

解决方案

Often times, in cases like Team City, the remote agent runs the files that were checked out by the CI machine, but does not have the .svn files (code is checked out in one place, but run in another). Such setups often have an option to do "Agent Side Checkout", which will checkout the code on the remote agent and thus bring the .svn folders to agent so that it can run relevant build number information functions.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top