IBM / cics-bundle-maven

The plugin to build and deploy CICS bundles in a Maven build.
https://ibm.github.io/cics-bundle-maven/plugin-info.html
Eclipse Public License 2.0
18 stars 25 forks source link

Non-reactor bundles fail to deploy if classifier is not set #151

Closed tom-foyle closed 4 months ago

tom-foyle commented 4 years ago

In the scenarios where we create a CICS bundle from an existing project, using the bundle-osgi / bundle-war / bundle-ear / bundle-eba goals, the classifier attribute claims to be optional with a default value of cics-bundle, but omitting it from pom.xml results in a deployment failure with the error message:

[ERROR] Failed to execute goal com.ibm.cics:cics-bundle-maven-plugin:1.0.1-SNAPSHOT:deploy (default) on project standalone-war: Some of the supplied parameters were invalid:
[ERROR]  - bundle: Error reading bundle manifest: Supplied CICS bundle must have a manifest at META-INF/cics.xml

Also, the comment in the samples makes it sound like the cics-bundle value is somehow significant to the packaging method, whereas I think it's actually just an arbitrary string which is appended to the zip filename?

<!-- The bundle classifier indicates that the war should be packaged into a CICS bundle -->
<classifier>cics-bundle</classifier>

Relevant doc pages: https://github.com/IBM/cics-bundle-maven#create-a-cics-bundle-from-an-existing-java-module-using-cics-bundle-maven-plugin https://ibm.github.io/cics-bundle-maven/bundle-war-mojo.html#classifier

ind1go commented 3 years ago

I'll use bundle-war below to mean all the bundle-war, bundle-ear, etc goals.

I think the thing here is that the bundle-war goal default to it being cics-bundle, but the deploy goal doesn't default to that because it could be being used to deploy a bundle created by either a bundle-war goal (where classifier will be cics-bundle or another classifier as specified) or a build goal (where there will be no classifier, at least not without explicitly setting it).

I think this will need to be a documentation fix and logging fix - not sure I can see a fix that makes it 'just work' for all combinations. Perhaps it's possible to work out which goals have run ahead of the deploy goal? @stewartfrancis

However, we could do the following:

Any other ideas?

ind1go commented 3 years ago

Would definitely be good to fix it though because I fall over it every time I create a new project! 😆