incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r759724 - in /incubator/sling/trunk/maven/maven-sling-plugin: pom.xml src/main/java/org/apache/sling/maven/bundlesupport/ValidationMojo.java
Date Sun, 29 Mar 2009 16:49:15 GMT
Author: cziegeler
Date: Sun Mar 29 16:49:15 2009
New Revision: 759724

URL: http://svn.apache.org/viewvc?rev=759724&view=rev
Log:
SLING-653 : Use new validator from commons.

Modified:
    incubator/sling/trunk/maven/maven-sling-plugin/pom.xml
    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/pom.xml
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/maven/maven-sling-plugin/pom.xml?rev=759724&r1=759723&r2=759724&view=diff
==============================================================================
--- incubator/sling/trunk/maven/maven-sling-plugin/pom.xml (original)
+++ incubator/sling/trunk/maven/maven-sling-plugin/pom.xml Sun Mar 29 16:49:15 2009
@@ -90,7 +90,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.commons.json</artifactId>
-            <version>2.0.2-incubator</version>
+            <version>2.0.3-incubator-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>

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=759724&r1=759723&r2=759724&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
Sun Mar 29 16:49:15 2009
@@ -28,9 +28,8 @@
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.project.MavenProject;
-import org.apache.sling.commons.json.JSONArray;
 import org.apache.sling.commons.json.JSONException;
-import org.apache.sling.commons.json.JSONObject;
+import org.apache.sling.commons.json.util.Validator;
 import org.codehaus.plexus.util.DirectoryScanner;
 
 /**
@@ -124,14 +123,9 @@
                 }
                 // first, let's see if this is a json array
                 try {
-                    new JSONArray(json);
+                    Validator.validate(json);
                 } catch (JSONException e) {
-                    // it might be a json object
-                    try {
-                        new JSONObject(json);
-                    } catch (JSONException je) {
-                        throw new MojoExecutionException("An Error occured while validating
the file '"+fileName+"'", je);
-                    }
+                    throw new MojoExecutionException("An Error occured while validating the
file '"+fileName+"'", e);
                 }
             }
         }



Mime
View raw message