Maria Odea Ching-2 wrote:
> 
> I think you're casting the wrong type here..
> 
> It should be,
> Xpp3Dom dom = (Xpp3Dom) plgn.getConfiguration();
> 
> ConfigurationContainer is extended by Plugin, and the getConfiguration() 
> method returns an Object which can be cast as an Xp33Dom. You can take a 
> look at this for an example:
> 
> http://svn.apache.org/repos/asf/maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.java
> 
> HTH,
> Deng
> 
> noon wrote:
>> I'm developing a basic M2 plugin for my project. The plugin itself works,
>> but
>> now I decided to finalize it with a more pro touch.
>>
>> My plugin uses almost the same kind of configuration than another M2
>> plugin
>> does (webstart-maven-plugin). Now the question is, am I able to read the
>> "webstart-maven-plugin"-plugins configurations in my own plugin or do I
>> need
>> to dublicate them as I do at the moment?
>>
>> I already tried
>>
>> Iterator iter = getProject().getBuildPlugins().iterator();
>> Plugin plgn = (Plugin) iter.next();
>> System.out.println("artifact: " + plgn.getArtifactId());
>> ConfigurationContainer pc = (ConfigurationContainer)
>> plgn.getConfiguration();
>>
>> But this gives me "java.lang.ClassCastException:
>> org.codehaus.plexus.util.xml.Xpp3Dom" at the last row in my example.
>>
>>
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

Some times the solutions are more simple than you ever expect them to be.
Thanks.... this solved the problem.

-- 
View this message in context: 
http://www.nabble.com/How-to-read-other-Maven-plugins-configuration--tf3824736s177.html#a10848406
Sent from the Maven - Users mailing list archive at Nabble.com.


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

Reply via email to