-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use project.build.finalName to derive artifact name #227
Conversation
MavenProjectHelper projectHelper) throws MojoExecutionException { | ||
try { | ||
bundlePublisher.publishDynamicResources(); | ||
|
||
ZipArchiver zipArchiver = new ZipArchiver(); | ||
zipArchiver.addDirectory(workDir); | ||
File cicsBundle = new File(outputDir, project.getArtifactId() + "-" + project.getVersion() + (classifier != null ? "-" + classifier : "") + "." + CICS_BUNDLE_EXTENSION); | ||
|
||
File cicsBundle = new File(outputDir, finalName + (classifier != null ? "-" + classifier : "") + "." + CICS_BUNDLE_EXTENSION); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't quite see how finalName defaults to
project.getArtifactId() + "-" + project.getVersion()
What have I missed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps I've misunderstood - I was expecting you could use that param to override the name, or just leave it out if you want the old behaviour. But it looks like it's a required param now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's built-in. Search for finalName
in here: https://maven.apache.org/pom.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addresses this issue raised here: #224
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It defaults to include the version, but some people may override it to try and remove adding the version to the final artifact's name. This is just adding support for that.
Signed-off-by: Stewart Francis <stewartfrancis@uk.ibm.com> Update pom.xml Update TestEndpoint.java Update PostBuildTestBundleWarFinalName.java
3f637c3
to
382bd1d
Compare
OK - @ind1go showed me that final name is a pre-existing maven feature which we're just overriding in this case, so the behaviour is remaining equivalent! |
Fixes #224
Note that the bundle is now created without a version, as verified by
test-bundle-war-final-name
. Internally within the bundle zip, the resulting war file will still have a version.Note that if you're using the
deploy
goal with the bundle deploy API, the resulting bundle directory will still have the version number in, as it's derived from the version in the manifest within the bundle file, not the bundle file name.This is still useful for scenarios where you're deploying the resulting bundle file yourself though