Hi,

I'm creating a plugin for Maven (3.0.3) which is to provide a custom packaging type to compile drools rules and would like to assign a custom file extension to the generated artifact. However I got stuck: - the generated file extension corresponds to the type given to the ArtifactHandler (or even to the role hint, they are the same in my case), but this is way too long for a file extension - I cannot use the specified <packaging> identifier in my test poms (Maven complains: "unknown packaging")

Here are some source code snippets:

components.xml:
https://github.com/ansgarkonermann/maven-drools-plugin/blob/47cb8704f00fb8d1f4b8bff9cc5bb445a8bd2c85/maven-drools-plugin/src/main/resources/META-INF/plexus/components.xml

example pom.xml:
https://github.com/ansgarkonermann/maven-drools-plugin/blob/47cb8704f00fb8d1f4b8bff9cc5bb445a8bd2c85/maven-drools-plugin/src/test/resources/de/lightful/maven/plugins/drools/integrationtests/can_compile_single_file/pom.xml

CompileMojo.java:
https://github.com/ansgarkonermann/maven-drools-plugin/blob/47cb8704f00fb8d1f4b8bff9cc5bb445a8bd2c85/maven-drools-plugin/src/main/java/de/lightful/maven/plugins/drools/mojos/CompileMojo.java

Does someone have a pointer to a good explanation of what an ArtifactHandler is supposed to do, and how it should be used? The javadoc of interface ArtifactHandler is empty, unfortunately.

In particular, I'd like to know:
- does the <role-hint> in components.xml have any meaning besides helping with dependency injection of components which share the same interface? Will a role-hint ever appear in a pom.xml to specify the <packaging>? - is it possible to define the string I have to use in a pom to specify the <packaging> by using the <packaging> element/attribute of a DefaultArtifactHandler?
- which roles do all the other attributes of DefaultArtifactHandler play?
- are there any "well known resources" which I should read before continuing plugin development (besides the source code itself, which is what I'd like to prevent)? I could not find much in-depth description regarding the inner workings of maven in the well-known book "Maven: The Complete Reference" and the JavaDoc seem patchy.

I'd be very glad if someone could push me into the right direction.

Thanks in advance

Ansgar

Reply via email to