How to create a custom Maven packaging type with custom plugin configurations

312 views Asked by At

I have created a custom packaging type foo and foo has a LifecycleMapping where it calls several plugins. Is it possible to provide default <configuration/> or pom.xml for these plugins and phases?

I want to add a default configuration for the doSomething pluging in the <package> phase listed below.

<component-set>
<components>
    <component>
        <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
        <role-hint>foo</role-hint>
        <implementation>
            org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping
        </implementation>
        <configuration>
            <phases>
                <package>
                    packaing:definition:doSomething
                </package>
            </phases>
        </configuration>
    </component>
    <component>
        <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
        <role-hint>foo</role-hint>
        <implementation>
            org.apache.maven.artifact.handler.DefaultArtifactHandler
        </implementation>
        <configuration>
            <extension>jar</extension>
            <type>foo</type>
            <packaging>foo</packaging>
            <language>java</language>
            <addedToClasspath>true</addedToClasspath>
        </configuration>
    </component>
</components>

0

There are 0 answers