Hi,
I would like to be able to configure my plugin with properties that are
stored in the settings.xml.
Here is a piece of my settings.xml :

<settings>
...
   <profiles>
       <profile>
           <id>database-developer</id>
           <activation>
               <property>
                   <name>!database</name>
               </property>
           </activation>
           <properties>
               <databaseServer>ad_daf1</databaseServer>
               <databasePort>34105</databasePort>
           </properties>
       </profile>
   </profiles>
...
</settings>


Here is a pom to test my plugin :

<project>
   <name>POM For test</name>
   <build>
       <plugins>
           <plugin>
               <artifactId>maven-antrun-plugin</artifactId>
               <executions>
                   <execution>
                       <phase>compile</phase>
                       <configuration>
                           <tasks>
                               <echo>databaseServer :
${databaseServer}</echo>
                            </tasks>

                       </configuration>
                       <goals>
                           <goal>run</goal>
                       </goals>
                   </execution>
               </executions>
           </plugin>
           <plugin>
               <groupId>...</groupId>
               <artifactId>...</artifactId>
               <configuration>
                   <databaseServer>${databaseServer}</databaseServer>
                   <databasePort>${databasePort}</databasePort>
               </configuration>
           </plugin>
       </plugins>
   </build>
</project>

If I execute my plugin, the ant task resolve the property ${databaseServer}.
But, in my mojo, I inject these properties and  ${databaseServer} isn't
resolved, so my attribute databaseServer equals "${databaseServer}".
How can I do to resolve these properties in my mojo ? Do I need to
explicitely use something like the plexus ExpressionEvaluator to resolve
them (a piece of code may help me) ?

Thanks

Olivier

Reply via email to