Build numbers for project?

Answered

I want to know how to keep track of each build in my project. Does IntelliJ record which version/build of my project I'm currently running? I want this to be displayed on the about screen as well. I know MS visual studio keeps track of the major/minor and build numbers for projects...and I'm pretty sure IntelliJ does as well, I'm just not sure how to make use of it. Help appreciated - thanks!

0
5 comments
Avatar
Permanently deleted user

There is no direct support in IDEA for build numbers. Most Java builds use Ant, or possibly Maven, both of which have support for build number generation.

--Dave Griffith

0

Is this still true? Where can I find Maven or Ant plugins that works in IDEA please?

0

Mikedepetris, could you clarify the issue please?

0

Thanks Andrey Dernov, I have a project with two modules, one is the java backend with maven, the other is an angular webapp frontend for which I set up a script to increase the build number in package.json at each prod build.

I would like to do the same for the java module, I see there are a couple of maven extensions like jgitversions but wanted to know what may be a recommended setup.

What I need is run the prod build process, increase the minor version of the build (maybe in pom.xml or wherever the application can read it), create a git tag and possibly commit with a comment it so it will be pushed at the next time.

At the moment I am doing this in the package.json with these:

"prebuild": "echo npm_package_version: %npm_package_version% && FOR /f \"tokens=*\" %a in ('npm version patch --git-tag-version -m \"Upgrade to %s before prod build\"') do SET OUTPUT=%a && call echo new version: %OUTPUT% && echo npm_package_version: %npm_package_version% && git add package.json package-lock.json && git commit -m \"Bump version\" && call git tag %OUTPUT% && echo PREBUILD END",
"build": "ng build --prod --aot --base-href=/apps/",
0

Thanks for the information. From the IDE side there is no such support. For the Maven, I would explore these options: https://stackoverflow.com/a/38163969/2000323

0

Please sign in to leave a comment.