You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ke...@apache.org on 2007/05/31 16:22:26 UTC

svn commit: r543141 - /maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/IdeUtils.java

Author: kenney
Date: Thu May 31 07:22:25 2007
New Revision: 543141

URL: http://svn.apache.org/viewvc?view=rev&rev=543141
Log:
PR: MNG-3012

Don't cast to Xpp3Dom as in 2.1 that's shaded.

Modified:
    maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/IdeUtils.java

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/IdeUtils.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/IdeUtils.java?view=diff&rev=543141&r1=543140&r2=543141
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/IdeUtils.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/IdeUtils.java Thu May 31 07:22:25 2007
@@ -335,7 +335,30 @@
 
             if ( plugin.getArtifactId().equals( ARTIFACT_MAVEN_COMPILER_PLUGIN ) )
             {
-                Xpp3Dom o = (Xpp3Dom) plugin.getConfiguration();
+                Xpp3Dom o;
+                try
+                {
+                    o = Xpp3DomBuilder.build( new StringReader( plugin.getConfiguration().toString() ) );
+                }
+                catch ( XmlPullParserException e )
+                {
+                        IllegalStateException error =
+                            new IllegalStateException( "Failed to read configuration for plugin: "
+                                                       + plugin.getKey() );
+                        error.initCause( e );
+
+                        throw error;
+                }
+                catch ( IOException e )
+                {
+                    IllegalStateException error =
+                        new IllegalStateException( "Failed to read configuration for plugin: "
+                                                   + plugin.getKey() );
+                    error.initCause( e );
+
+                    throw error;
+                }
+
 
                 // this is the default setting
                 if ( ( o != null ) && ( o.getChild( optionName ) != null ) )