I have a task that calculates a version number via an exec type. I use it to insert a version file into the output jar.
I would like to inject the version number into a jar manifest. However, the manifest is created during configuration. How do I delay the manifest creation? Alternatively, how can I get the version file during config?
Taking the file << out of doLast means the file is empty. Putting the mainfest in doLast doesn’t work.
So it all worked. Jar was good with format myJar-X.X.X.jar , and code committed. Then Jenkins builds the jar with a different version? workspace-jenkins-myJar-buildNumber.jar
Jenkins uses the dir name to figure out the jar name: eg “workspace” The version number I set from git describe, but jenkins adds annotated tags to git - hence the jenkins-myJar-buildNumber