Brett Porter wrote:


The way I got it to work was to add a property activator inside the
profile and to set that property from the command line.


Would you mind providing an example of what worked for you? I looked at the 
Build Profiles page at http://docs.codehaus.org/display/MAVEN/Build+Profiles 
and I found the following:

<profile>
 <id>hsqldb</id>
 <activation>
   <property>hsqldb.enabled</property>
 </activation>
 <dependencies>
   <dependency>
     <groupId>hsqldb</groupId>
     .
     .
</profile>

That syntax wouldn't parse. Eventually, after a number of tries (I tried to 
follow the example @ (http://maven.apache.org/maven2/maven-model/maven.html) I 
found that this non-matching syntax didn't work but only because all of the 
values were not filled in, the parser didn't complain about the syntax.

   <profile>
     <id>all-models</id>
     <activation>
       <property>
         <name/>
         <value/>
       </property>
     </activation>

But when I filled it in:

   <profile>
     <id>all-models</id>
     <activation>
       <property>
         <name>allmodels.enabled</name>
         <value>true</value>
       </property>
     </activation>

and invoked m2 as follows:

m2 -Dallmodels.enabled=true generate-sources

I encountered the error trace listed below.

Again, an example of what worked for you would be greatly appreciated.



[ERROR] BUILD ERROR
[INFO] -------------------------------------------------------------------------
---
[INFO] Diagnosis: Error configuring plugin for execution of 'modello:xpp3-writer
'.
[INFO] -------------------------------------------------------------------------
---
[ERROR] Cause:
org.apache.maven.plugin.MojoExecutionException: Error configuring plugin for exe
cution of 'modello:xpp3-writer'. at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:316)
       at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:478)
       at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:451)
       at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:437)
       at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
       at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131)
       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186)
       at org.apache.maven.cli.MavenCli.main(MavenCli.java:316)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
       at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
       at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

       at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.PluginParameterException: Invalid or missing 
parameters: [Mojo parameter [name: 'model'; alias: 'null']] for mojo: 
org.codehaus.modello:modello-maven-plugin:1..0-alpha-4-SNAPSHOT:xpp3-writer
       at 
org.apache.maven.plugin.DefaultPluginManager.checkRequiredParameters(DefaultPluginManager.java:756)
       at 
org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:494)
       at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:311)
       ... 15 more
[INFO] -------------------------------------------------------------------------
---
[INFO] Total time: 4 seconds
[INFO] Finished at: Wed Sep 07 09:36:08 EDT 2005
[INFO] Final Memory: 4M/7M
[INFO] -------------------------------------------------------------------------
---






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to