This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag maven-sling-plugin-2.0.4-incubator
in repository https://gitbox.apache.org/repos/asf/sling-maven-sling-plugin.git

commit c94aed2882f1023fc329e27b09951c2aee2afecb
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Sun Mar 29 16:49:15 2009 +0000

    SLING-653 : Use new validator from commons.
    
    git-svn-id: 
https://svn.apache.org/repos/asf/incubator/sling/trunk/maven/maven-sling-plugin@759724
 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                                      |  2 +-
 .../org/apache/sling/maven/bundlesupport/ValidationMojo.java | 12 +++---------
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/pom.xml b/pom.xml
index 84d67ed..19e7f91 100644
--- a/pom.xml
+++ b/pom.xml
@@ -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>
diff --git 
a/src/main/java/org/apache/sling/maven/bundlesupport/ValidationMojo.java 
b/src/main/java/org/apache/sling/maven/bundlesupport/ValidationMojo.java
index 034ead8..39ce9f7 100644
--- a/src/main/java/org/apache/sling/maven/bundlesupport/ValidationMojo.java
+++ b/src/main/java/org/apache/sling/maven/bundlesupport/ValidationMojo.java
@@ -28,9 +28,8 @@ import org.apache.maven.model.Resource;
 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 @@ public class ValidationMojo extends AbstractMojo {
                 }
                 // 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);
                 }
             }
         }

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to