Well, that reference had a lot of helpful information, but it still
isn't working for me.
I have this in my settings.xml:
<settings>
<profiles>
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<devenv71Path>C:\a\b\71</devenv71Path>
</properties>
</profile>
</profiles>
<pluginGroups>
<pluginGroup>no.fast.buildprocess</pluginGroup>
</pluginGroups>
</settings>
According to the intro to profiles page, I should be able to put this in
my pom.xml to configure my plugin using this value:
<build>
<plugins>
<plugin>
<groupId>no.fast.buildprocess</groupId>
<artifactId>vstudio</artifactId>
<executions>
<execution>
<goals>
<goal>buildsln</goal>
</goals>
<configuration>
<devenv71Path>${devenv71Path}</devenv71Path>
<solutionDir>src/main/cpp/myproject</solutionDir>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
(The fact that my property name matches the plugin configuration
property name is just a coincidence--I get the same result if the names
are different.)
When I execute the goal, however, all I get is a NullPointerException:
at
org.codehaus.plexus.component.configurator.converters.ComponentValueSett
er.configure(ComponentValueSetter.java:247)
at
org.codehaus.plexus.component.configurator.converters.composite.ObjectWi
thFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:13
7)
at
org.codehaus.plexus.component.configurator.BasicComponentConfigurator.co
nfigureComponent(BasicComponentConfigurator.java:56)
at
org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(Defaul
tPluginManager.java:1031)
at
org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPl
uginManager.java:576)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginMa
nager.java:390)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
LifecycleExecutor.java:519)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifec
ycle(DefaultLifecycleExecutor.java:469)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL
ifecycleExecutor.java:448)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle
Failures(DefaultLifecycleExecutor.java:301)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:268)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifec
ycleExecutor.java:137)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.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)
Should this work? Am I using the wrong syntax?
I'd really like to be able to make the plugin read the property from
settings.xml directly, and have the property be optional (so it uses a
default if the property isn't set). Is this possible?
..David..
-----Original Message-----
From: Odea Ching [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 22, 2005 6:12 PM
To: Maven Users List
Subject: Re: [m2] How to set a Mojo property from settings.xml
Hi David,
Check out this url from the Maven documentation for setting the
configuration in the settings.xml file:
http://maven.apache.org/guides/introduction/introduction-to-profiles.htm
l
Regards,
Deng
David Jackman wrote:
>One of the properties for a Mojo I'm writing is really a user-specific
>thing, and ought to be set in each user's settings.xml file. The guide
>for configuring plugins only talks about setting configuration
>properties in pom.xml, but not how to reference values set in
>settings.xml. How do I do this?
>
>..David..
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]