incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r763554 - /incubator/sling/trunk/maven/maven-sling-plugin/src/main/java/org/apache/sling/maven/bundlesupport/ValidationMojo.java
Date Thu, 09 Apr 2009 08:27:41 GMT
Author: cziegeler
Date: Thu Apr  9 08:27:41 2009
New Revision: 763554

URL: http://svn.apache.org/viewvc?rev=763554&view=rev
Log:
Default resources directory might not exists.

Modified:
    incubator/sling/trunk/maven/maven-sling-plugin/src/main/java/org/apache/sling/maven/bundlesupport/ValidationMojo.java

Modified: incubator/sling/trunk/maven/maven-sling-plugin/src/main/java/org/apache/sling/maven/bundlesupport/ValidationMojo.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/maven/maven-sling-plugin/src/main/java/org/apache/sling/maven/bundlesupport/ValidationMojo.java?rev=763554&r1=763553&r2=763554&view=diff
==============================================================================
--- incubator/sling/trunk/maven/maven-sling-plugin/src/main/java/org/apache/sling/maven/bundlesupport/ValidationMojo.java
(original)
+++ incubator/sling/trunk/maven/maven-sling-plugin/src/main/java/org/apache/sling/maven/bundlesupport/ValidationMojo.java
Thu Apr  9 08:27:41 2009
@@ -80,25 +80,27 @@
         while ( rsrcIterator.hasNext() ) {
             final Resource rsrc = rsrcIterator.next();
 
-            getLog().debug("Scanning " + rsrc.getDirectory());
             final File directory = new File(rsrc.getDirectory());
-            final DirectoryScanner scanner = new DirectoryScanner();
-            scanner.setBasedir( directory );
+            if ( directory.exists() ) {
+                getLog().debug("Scanning " + rsrc.getDirectory());
+                final DirectoryScanner scanner = new DirectoryScanner();
+                scanner.setBasedir( directory );
 
-            if ( rsrc.getExcludes() != null && rsrc.getExcludes().size() > 0 )
{
-                scanner.setExcludes( (String[]) rsrc.getExcludes().toArray(new String[rsrc.getExcludes().size()]
) );
-            }
-            scanner.addDefaultExcludes();
-            if ( rsrc.getIncludes() != null && rsrc.getIncludes().size() > 0 )
{
-                scanner.setIncludes( (String[]) rsrc.getIncludes().toArray(new String[rsrc.getIncludes().size()]
));
-            }
+                if ( rsrc.getExcludes() != null && rsrc.getExcludes().size() >
0 ) {
+                    scanner.setExcludes( (String[]) rsrc.getExcludes().toArray(new String[rsrc.getExcludes().size()]
) );
+                }
+                scanner.addDefaultExcludes();
+                if ( rsrc.getIncludes() != null && rsrc.getIncludes().size() >
0 ) {
+                    scanner.setIncludes( (String[]) rsrc.getIncludes().toArray(new String[rsrc.getIncludes().size()]
));
+                }
 
-            scanner.scan();
+                scanner.scan();
 
-            final String[] files = scanner.getIncludedFiles();
-            if ( files != null ) {
-                for(int m=0; m<files.length; m++) {
-                    this.validate(directory, files[m]);
+                final String[] files = scanner.getIncludedFiles();
+                if ( files != null ) {
+                    for(int m=0; m<files.length; m++) {
+                        this.validate(directory, files[m]);
+                    }
                 }
             }
         }



Mime
View raw message