You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ep...@apache.org on 2007/05/11 19:25:09 UTC

svn commit: r537239 - /maven/plugins/trunk/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaModuleMojo.java

Author: epunzalan
Date: Fri May 11 10:25:08 2007
New Revision: 537239

URL: http://svn.apache.org/viewvc?view=rev&rev=537239
Log:
[MIDEA-92] Added a check that will remove the <exclude-output> in the iml file when there are sources/resources beneath the output directories.

Modified:
    maven/plugins/trunk/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaModuleMojo.java

Modified: maven/plugins/trunk/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaModuleMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaModuleMojo.java?view=diff&rev=537239&r1=537238&r2=537239
==============================================================================
--- maven/plugins/trunk/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaModuleMojo.java (original)
+++ maven/plugins/trunk/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaModuleMojo.java Fri May 11 10:25:08 2007
@@ -392,6 +392,20 @@
                 }
             }
 
+            //Remove default exclusion for output dirs if there are sources in it
+            String outputModuleUrl = getModuleFileUrl( executedProject.getBuild().getOutputDirectory() );
+            String testOutputModuleUrl = getModuleFileUrl( executedProject.getBuild().getTestOutputDirectory() );
+            for ( Iterator i = content.elements( "sourceFolder" ).iterator(); i.hasNext(); )
+            {
+                Element sourceFolder = (Element) i.next();
+                String sourceUrl = sourceFolder.attributeValue( "url" ).replace( '\\', '/' );
+                if ( sourceUrl.startsWith( outputModuleUrl + "/" ) || sourceUrl.startsWith( testOutputModuleUrl ) )
+                {
+                    component.remove( component.element( "exclude-output" ) );
+                    break;
+                }
+            }
+
             rewriteDependencies( component );
 
             writeXmlDocument( moduleFile, document );