Hello,
I am trying to write a XSLT transform plugin for m2 and I am running
into a problem getting a custom converter to work. The converter is
very similar to AntRun's converter.
The relevant config blocks are listed below:
plugin usage block in calling pom:
<plugin>
<groupId>com.meltmedia.maven.plugins.xslt</groupId>
<artifactId>maven-xslt-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<pipelines>
<pipeline>
<output name="method" value="xml"/>
<source href="${basedir}/src/main/resources/config/
config.xml"/>
<transform href="${basedir}/src/main/resources/
transform/config.xsl">
<param name="mode" value="DEVEL"/>
</transform>
<result href="${project.build.directory}/
config.xml"/>
</pipeline>
</pipelines>
</configuration>
<goals>
<goal>transform</goal>
</goals>
</execution>
</executions>
</plugin>
components.xml:
<plexus>
<components>
<component>
<role>org.codehaus.plexus.component.configurator.ComponentConfigurator</
role>
<role-hint>override</role-hint>
<implementation>org.codehaus.plexus.component.configurator.BasicComponen
tConfigurator</implementation>
<requirements>
<requirement>
<role>org.codehaus.plexus.component.configurator.converters.lookup.Conve
rterLookup</role>
<role-hint>override</role-hint>
</requirement>
</requirements>
</component>
<component>
<role>org.codehaus.plexus.component.configurator.converters.lookup.Conve
rterLookup</role>
<role-hint>override</role-hint>
<implementation>org.codehaus.plexus.component.configurator.converters.lo
okup.DefaultConverterLookup</implementation>
<requirements>
<requirement>
<role>org.codehaus.plexus.component.configurator.converters.Configuratio
nConverter</role>
<role-hint>Pipelines</role-hint>
<field-name>customConverters</field-name>
</requirement>
</requirements>
</component>
<component>
<role>org.codehaus.plexus.component.configurator.converters.Configuratio
nConverter</role>
<role-hint>Pipelines</role-hint>
<implementation>com.meltmedia.maven.plugins.xslt.components.PipelinesCon
verter</implementation>
</component>
</components>
</plexus>
Injection point in mojo:
/*
* @parameter expression="${pipelines}"
*/
private Pipelines pipelines;
The mojo has @configurator override defined.
I put log statements in the canConvert method in my
PipelinesConverter and it's only being called once for the plugin's
execution, and that is with type of
org.apache.maven.project.MavenProject. This is because I also inject
the project, if I remove the project injection the canConvert method
is never called.
Any thoughts?
: mike moulton
: meltmedia
: 1429 north 1st street
: phoenix az 85004
:
: [EMAIL PROTECTED]
: mmoulton66 | aim
: 602.340.9440 | ofc
: 602.432.2568 | cel
: 602.340.1003 | fax
:
: meltmedia.com