Alright, I will add Setter methods that should help. Actually I thought it
was a great feature. Otherwise you would have a 1:1 mapping between the java
field name and the xml-tag name in the <configuration> section of your
plugin in the pom...


Brian E Fox wrote:
> 
> Interesting. I think it's safe to say this is rarely used and you might be
> seeing a bug. Just rename your private variables and see if it works.
> 
> 
> On 1/21/09 10:19 AM, "Reik Schatz" <[email protected]> wrote:
> 
>> 
>> I have it from here:
>> http://maven.apache.org/developers/mojo-api-specification.html
>> Search for "alias".
>> 
>> /Reik
>> 
>> 
>> 
>> 
>> Brian E Fox wrote:
>>> 
>>> Where did you see the alias notation? This isn't something I've seen
>>> before.
>>> 
>>> 
>>> On 1/21/09 8:27 AM, "Reik Schatz" <[email protected]> wrote:
>>> 
>>>> 
>>>> Hi,
>>>> 
>>>> I am working on a maven 2 plugin. My AbstractMojo has something like
>>>> this:
>>>> 
>>>> 
>>>>     /**
>>>>      * @parameter alias="errorfile"
>>>>      */
>>>>     private String m_errorFile;
>>>> 
>>>> 
>>>> I want to test the mojo using maven-plugin-testing-harness:
>>>> 
>>>> 
>>>> <dependency>
>>>>   <groupId>org.apache.maven.plugin-testing</groupId>
>>>>   <artifactId>maven-plugin-testing-harness</artifactId>
>>>>   <version>1.2</version>
>>>>   <scope>test</scope>
>>>> </dependency>
>>>> 
>>>> 
>>>> When I run my test, I get an error message saying
>>>> org.codehaus.plexus.component.configurator.ComponentConfigurationException:
>>>> Cannot find setter nor field in
>>>> com.google.maven.TestabilityExplorerMojo
>>>> for
>>>> 'errorfile' which is true as there is no field errorfile or
>>>> setErrorfile.
>>>> However, Maven would be using the alias for setting the field. How can
>>>> I
>>>> get
>>>> my test to recognize that there is an alias 'errorfile'?
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> 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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/testing-harness-and-alias-tp21583127p21585443.html
Sent from the Maven Developers mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to