Skip to end of metadata
Go to start of metadata

I posted this on the Maven Users forum, but there was no response.  Lukas suggested I try this wiki as a discussion forum:

Anyone know if it is possible to override component property values inside plugins in the pom somehow?  The process of converting the <configuration> XML elements from <build><plugins><plugin> is a little bit of a dark art.  It is obvious from the "mvn -X" debug output when you add a <configuration> element, and it does seem to be injected into the plugin Mojo directly into an annotated @parameter .  But @component dependencies of the plugin (e.g. doxiaBook in the DoxiaRenderBooksMojo) do not seem to be accessible from the pom.  I figure Plexus ought to be able to do something like this, but I can't find any examples or documentation.

What we need really is to be able to configure the modules, like Confluence, and other dependencies, in particular the BookRenderers from a POM during "mvn site".  Exampe: the default rendering of doc-book books really isn't very useful (SGML, no system id in the DTD declaration, no document root - see DOXIA-160, DOXIA-166).  Ideally we would like to change the rendering options at runtime something like

 

Labels
  • None
  1. Oct 29, 2007

    I think the following layout is more useful (you could have different books with different configurations). The list of parameters could be injected by the doxia-maven-plugin into doxia-book, which has to forward it to the sink:

       <configuration>
        <books>
          <book>
            <directory>src/books/example-book</directory>
            <descriptor>src/books/example-book.xml</descriptor>
            <formats>
              <format>
                <id>doc-book</id>
                <config>
                  <param name="xml" value="true">
                  <param name="systemId" value="http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                  ...
                </config>
              </format>
              ...
    
  2. Oct 29, 2007

    That's fine I guess. I assume this is not yet implemented. But how can it be implemented? How can the plugin inject that configuration into its renderer? Then the renderer has to manually transfer its injected properties to the Sink that it creates. Is there a Plexus utility for that as well, or would the Sink hasve to become a 1st class Plexus component? Is that possible? Is there a "prototype" pattern for Plexus components?