You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Coxon <MC...@fairfaxdigital.com.au> on 2008/11/04 02:26:08 UTC

Mojo fails to read parameters fed via plugin config

Maven 2.09, Windows XP, Java 1.5
 
I have built a Mojo which extends AbstractMojo via a couple of abstract
classes. These abstracts themselves request parameters, such that the
list of declarted parameters is:
 
    /**
     * @parameter expression="${localRepository}"
     */
    protected ArtifactRepository localRepository;

    /**
     * @parameter default-value="../../tomcat/ingestor/bin"
     */
    protected String ingestorContainerBinaryDirectory;
 
    /**
     * @parameter default-value="../../tomcat/deliverer/bin"
     */
    protected String delivererContainerBinaryDirectory;
 
    /**
     * @parameter default-value="../../tomcat/production-interface/bin"
     */
    protected String productionInterfaceContainerBinaryDirectory;

    /**
     * ingestor start script.
     * @parameter
     */
    private String startCommand;
 
    /**
     * ingestor start VM args.
     * @parameter default-value="catalina.bat start"
     */
    private String ingestorEnvSettings;
 
    /**
     * proof start VM args.
     * @parameter default-value=""
     */
    private String proofDelivererEnvSettings;
 
    /**
     * public start VM args.
     * @parameter default-value=""
     */
    private String publicDelivererEnvSettings;
 
    /**
     * pi start VM args.
     * @parameter default-value=""
     */
    private String productionInterfaceEnvSettings;

 
The plugin definition:
 
            <plugin>
                <groupId>fairfaxdigital.build.plugins</groupId>
                <artifactId>ubercommand-plugin</artifactId>
                <version>1.0-SNAPSHOT</version>
                <configuration>
                    <greeting>Welcome</greeting>
                </configuration>
                <executions>
 
                    <execution>
                        <id>cleancopy</id>
                        <goals>
                            <goal>clean</goal>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <ingestorTargetDirectory>
                                ../ingestor/feeds/webapp/target
                            </ingestorTargetDirectory>
                            <delivererTargetDirectory>
                                ../deliverer/sites/deliverer/target
                            </delivererTargetDirectory>
                            <productionInterfaceTargetDirectory>
                                ../production-interface/webapp/target
                            </productionInterfaceTargetDirectory>
                        </configuration>
                    </execution>
 
                    <execution>
                        <id>torun</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <ingestorContainerBinaryDirectory>
                                ../../tomcat/ingestor/bin
                            </ingestorContainerBinaryDirectory>
                            <ingestorEnvSettings>
                                -Xmx512m -Denv=devtomcat
-Dcomms.alias.suffix=MIKE
-Dframework.conf.beans=classpath*:spring-external/*.xml,file:C:\dcds\cod
e\deliverer-trunk\sites\sites-common\src\main\resources\spring-external/
ui-designsets.xml,file:C:\dcds\code\common\media-common\src\main\resourc
es\spring-external\media-common-ui-designsets.xml
                            </ingestorEnvSettings>
 
                            <delivererContainerBinaryDirectory>
                                ../../tomcat/deliverer/bin
                            </delivererContainerBinaryDirectory>
                            <proofDelivererEnvSettings>
                                -Xmx512m -Denv=proof-devtomcat
-Dcomms.alias.suffix=MIKE
-Dframework.conf.beans=classpath*:spring-external/*.xml,classpath*:sprin
g-external-proof-devtomcat/*.xml
                            </proofDelivererEnvSettings>
                            <publicDelivererEnvSettings>
                                -Xmx512m -Denv=deliverer-devtomcat
-Dcomms.alias.suffix=MIKE
-Dframework.conf.beans=classpath*:spring-external/*.xml,classpath*:sprin
g-external-deliverer-devtomcat/*.xml
                            </publicDelivererEnvSettings>
 
 
<productionInterfaceContainerBinaryDirectory>
                                ../../tomcat/production-interface/bin
 
</productionInterfaceContainerBinaryDirectory>
                            <productionInterfaceEnvSettings>
                                -Xmx512m -Denv=devtomcat
-Dcomms.alias.suffix=MIKE
-Dframework.conf.beans=classpath*:spring-external/*.xml,file:C:\dcds\cod
e\deliverer-trunk\sites\sites-common\src\main\resources\spring-external/
ui-designsets.xml,file:C:\dcds\code\common\media-common\src\main\resourc
es\spring-external\media-common-ui-designsets.xml
-Dcom.sun.management.jmxremote.port=9602
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
                            </productionInterfaceEnvSettings>
 
                            <startCommand>
                                catalina.bat start
                            </startCommand>
                        </configuration>
                    </execution>
 
                    <execution>
                        <id>tostop</id>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                        <configuration>
                            <ingestorContainerBinaryDirectory>
                                ../../tomcat/ingestor/bin
                            </ingestorContainerBinaryDirectory>
 
                            <delivererContainerBinaryDirectory>
                                ../../tomcat/deliverer/bin
                            </delivererContainerBinaryDirectory>
 
 
<productionInterfaceContainerBinaryDirectory>
                                ../../tomcat/production-interface/bin
 
</productionInterfaceContainerBinaryDirectory>
 
                            <stopCommand>
                                catalina.bat stop
                            </stopCommand>
                        </configuration>
                    </execution>
                </executions>
 
            </plugin>

 
The problem is that none of these parameter values are being read by the
mojo when I run mvn ubercommand:run. If I supply default values to each
of these parmeters, the default values are set (as expected) the
expression values are likewise set. but if I just have @parameter, no
values are set and the parameters values reamin null.
 
Since there seems to be little or no doco or support issues around this
I'm obviously missing something obvious. Could someone kindly point out
to me what I've missed.
 
thanks
 
Mike

The information contained in this e-mail message and any accompanying files is or may be confidential. If you are not the intended recipient, any use, dissemination, reliance, forwarding, printing or copying of this e-mail or any attached files is unauthorised. This e-mail is subject to copyright. No part of it should be reproduced, adapted or communicated without the written consent of the copyright owner. If you have received this e-mail in error please advise the sender immediately by return e-mail or telephone and delete all copies. Fairfax does not guarantee the accuracy or completeness of any information contained in this e-mail or attached files. Internet communications are not secure, therefore Fairfax does not accept legal responsibility for the contents of this message or attached files.