-
Notifications
You must be signed in to change notification settings - Fork 73
Description
Garret Wilson opened MASSEMBLY-993 and commented
Please add a classifier option to the Maven Assembly Plugin, similar to the Spring Boot Maven Plugin option of the same name, to allow a POM to explicitly indicate what classifier to append to the end of the artifact.
Generated Maven artifacts have an option of a "classifier" such as javadoc or sources. This is placed on the end of a artifact base filename, such as foo-1.2.3-javadoc.jar or foo-1.2.3-sources. See the description of classifiers in the Maven POM Reference for more details.
The Spring Boot Maven Plugin has a simple configuration to set the classifier. Thus if I specify bar as my classifier, then Spring Boot Maven Plugin generates foo-1.2.3-bar.jar.
The Maven Assembly Plugin's only equivalent facility is indirect and arguably semantically incorrect. Instead of specifying a "classifier", the Assembly Plugin has a Boolean option to append the assembly ID. The name of this option is a little unclear; what it's really saying is "use the assembly ID as the artifact classifier". Using the assembly ID as the classifier is not a bad default, but the problem is not allowing an option for an alternate classifier.
The drawback here is that the consumer of a public, published assembly descriptor has no control over what the ID is defined within the descriptor. There needs to be a way to specify the generated artifact classifier at the point of plugin definition, independent of what is defined in the descriptor. (Of course, if MASSEMBLY-992 were implemented, this would provide one workaround, although not solve the problem of consuming published artifact descriptors.)
As an example see symphoniacloud/lambda-packaging#1 . Symphonia publishes a Maven Assembly Plugin descriptor, but the ID it uses (for reasons I outline in that ticket) is less than ideal. If the Assembly Plugin simply were to allow a classifier option like Spring Boot Maven Plugin does, the POM could simply choose whatever it wants, independent of the ID in the assembly descriptor.
No further details from MASSEMBLY-993