fixed build for maven3
fixed npe for threading conditions



git-svn-id: https://svn.apache.org/repos/asf/myfaces/extensions/scripting/trunk@937636 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/extscript-core-root/extscript-core/pom.xml b/extscript-core-root/extscript-core/pom.xml
index 6349986..f39fd45 100644
--- a/extscript-core-root/extscript-core/pom.xml
+++ b/extscript-core-root/extscript-core/pom.xml
@@ -1,3 +1,4 @@
+
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -105,8 +106,13 @@
         <plugins>
            
             <plugin>
-                <groupId>org.codehaus.mojo.groovy</groupId>
-                <artifactId>groovy-maven-plugin</artifactId>
+                <groupId>org.codehaus.gmaven</groupId>
+                <artifactId>gmaven-plugin</artifactId>
+                <version>1.2</version>
+                <configuration>
+
+                    <providerSelection>1.7</providerSelection>
+                </configuration>
                 <executions>
                     <execution>
                         <goals>
@@ -123,6 +129,19 @@
                         <artifactId>groovy-all</artifactId>
                         <version>${groovy.version}</version>
                     </dependency>
+                    <!--
+                    <dependency>
+                        <groupId>org.codehaus.gmaven.runtime</groupId>
+                        <artifactId>gmaven-runtime-1.7</artifactId>
+                        <version>1.2</version>
+                        <exclusions>
+                            <exclusion>
+                                <groupId>org.codehaus.groovy</groupId>
+                                <artifactId>groovy-all</artifactId>
+                            </exclusion>
+                        </exclusions>
+                    </dependency>
+                    -->
                 </dependencies>
             </plugin>
 
diff --git a/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/util/WeavingContext.java b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/util/WeavingContext.java
index dbde6e4..6b647ae 100644
--- a/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/util/WeavingContext.java
+++ b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/util/WeavingContext.java
@@ -163,11 +163,11 @@
      * @return true in case of being scriptable
      */
     public static boolean isScriptingEnabled() {
-        return  _enabled.get();
+        return  _enabled != null && _enabled.get();
     }
 
     public static void setScriptingEnabled(boolean enabled) {
-        _enabled = new AtomicBoolean(enabled);
+        _enabled.set(enabled);
     }
 
     /**
@@ -182,7 +182,7 @@
      * @param enabled true set from out filter init
      */
     public static void setFilterEnabled(boolean enabled) {
-        _filterEnabled = new AtomicBoolean(enabled);
+        _filterEnabled.set(enabled);
     }
 
     /**
diff --git a/extscript-examples/myfaces12-example/src/main/webapp/blog.xhtml b/extscript-examples/myfaces12-example/src/main/webapp/blog.xhtml
index 867e4db..dbf663a 100644
--- a/extscript-examples/myfaces12-example/src/main/webapp/blog.xhtml
+++ b/extscript-examples/myfaces12-example/src/main/webapp/blog.xhtml
@@ -31,7 +31,9 @@
                 <h:inputText value="#{blogView.content}"/>
 
 
-                <h:commandLink action="#{blogView.addEntry}" value="Add Blog"/>
+                <h:commandLink action="#{blogView.addEntry}" value="Add Blog">
+                     <f:ajax execute="@this" render="content"/>
+                </h:commandLink>
             </h:panelGrid>
             <h:panelGrid columns="1">
                 <h:outputText value="Blog Entries"/>
diff --git a/extscript-examples/myfaces20-example/pom.xml b/extscript-examples/myfaces20-example/pom.xml
index 24268e9..7bb5635 100644
--- a/extscript-examples/myfaces20-example/pom.xml
+++ b/extscript-examples/myfaces20-example/pom.xml
@@ -74,14 +74,14 @@
         <dependency>
             <groupId>org.apache.myfaces.core</groupId>
             <artifactId>myfaces-api</artifactId>
-            <version>2.0.0-beta-3</version>
+            <version>${myfaces2.version}</version>
             <scope>compile</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.myfaces.core</groupId>
             <artifactId>myfaces-impl</artifactId>
-            <version>2.0.0-beta-3</version>
+            <version>${myfaces2.version}</version>
             <scope>compile</scope>
         </dependency>
 
@@ -99,26 +99,29 @@
              if you want to run bean validation
              and/or MyFaces ext-val
          -->
+
+        
         <dependency>
             <groupId>org.apache.myfaces.extensions.validator</groupId>
             <artifactId>myfaces-extval-core</artifactId>
-            <version>2.0.3</version>
-            <scope>compile</scope>
+            <version>${extval.version}</version>
         </dependency>
 
+        <!--
         <dependency>
             <groupId>org.apache.myfaces.extensions.validator.validation-modules</groupId>
             <artifactId>myfaces-extval-property-validation</artifactId>
-            <version>2.0.3</version>
-            <scope>compile</scope>
+            <version>${extval.version}</version>
         </dependency>
-
+        -->
+        
         <dependency>
             <groupId>org.apache.myfaces.extensions.validator.validation-modules</groupId>
             <artifactId>myfaces-extval-bean-validation</artifactId>
-            <version>2.0.3</version>
-            <scope>compile</scope>
+            <version>${extval.version}</version>
         </dependency>
+
+        
         <dependency>
             <groupId>org.hibernate</groupId>
             <artifactId>hibernate-validator</artifactId>
diff --git a/extscript-examples/myfaces20-example/src/main/java/org/apache/myfaces/blank/TestValidator2.java b/extscript-examples/myfaces20-example/src/main/java/org/apache/myfaces/blank/TestValidator2.java
new file mode 100644
index 0000000..625d503
--- /dev/null
+++ b/extscript-examples/myfaces20-example/src/main/java/org/apache/myfaces/blank/TestValidator2.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.blank;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class TestValidator2 implements Validator {
+  public void validate(FacesContext facesContext, UIComponent uiComponent, Object o) {
+    System.out.println("validating aaaa ");
+  }
+}
diff --git a/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/facelets/groovy-taglib.xml b/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/facelets/groovy-taglib.xml
index 92c6554..7fb4439 100644
--- a/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/facelets/groovy-taglib.xml
+++ b/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/facelets/groovy-taglib.xml
@@ -9,7 +9,9 @@
     <tag>
         <tag-name>groovyvalidator</tag-name>
         <validator>
+
             <validator-id>org.apache.myfaces.groovyloader.test.TestValidator</validator-id>
+           
         </validator>
     </tag>
     <tag>
diff --git a/extscript-examples/myfaces20-example/src/main/webapp/blog.xhtml b/extscript-examples/myfaces20-example/src/main/webapp/blog.xhtml
index 406eb04..2dcef4a 100644
--- a/extscript-examples/myfaces20-example/src/main/webapp/blog.xhtml
+++ b/extscript-examples/myfaces20-example/src/main/webapp/blog.xhtml
@@ -1,8 +1,11 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
-      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
-      xmlns:t="http://myfaces.apache.org/tomahawk" xmlns:grv="http://myfaces.apache.org/groovy">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:ui="http://java.sun.com/jsf/facelets"
+      xmlns:f="http://java.sun.com/jsf/core"
+      xmlns:h="http://java.sun.com/jsf/html"
+      xmlns:t="http://myfaces.apache.org/tomahawk"
+      xmlns:grv="http://myfaces.apache.org/groovy">
 <head>
     <title>Hello World</title>
 </head>
@@ -33,14 +36,16 @@
                     </h:panelGrid>
                     <h:panelGrid columns="2" columnClasses="label, input">
                         <h:outputText styleClass="label" value="Content"/>
-                        <h:inputTextarea value="#{blogView.content}"/>
+                        <h:inputText value="#{blogView.content}"/>
                     </h:panelGrid>
                     <hr/>
-                    <h:commandButton styleClass="btn" action="#{blogView.addEntry}" value="Add Blog Entry"/>
+                    <h:commandButton styleClass="btn" action="#{blogView.addEntry}" value="Add Blog Entry">
+                       
+                    </h:commandButton>
                 </h:panelGrid>
             </div>
 
-            <h:panelGrid columns="1" styleClass="right">
+            <h:panelGrid id="content" columns="1" styleClass="right">
                 <ui:repeat value="#{blogService.blogEntries}" var="item">
                     <h:panelGrid columns="1" styleClass="messageBox">
                         <h:panelGroup styleClass="topic">
diff --git a/extscript-examples/myfaces20-example/src/main/webapp/helloWorld.xhtml b/extscript-examples/myfaces20-example/src/main/webapp/helloWorld.xhtml
index efa2dd6..48038cf 100644
--- a/extscript-examples/myfaces20-example/src/main/webapp/helloWorld.xhtml
+++ b/extscript-examples/myfaces20-example/src/main/webapp/helloWorld.xhtml
@@ -40,6 +40,7 @@
                     <br/>
                     <h:outputFormat escape="false" value="#{javatestbean.sayHello}"/>
                 </h:panelGroup>
+                <!--
                 <h:panelGroup styleClass="stdBox">
                     <h3>Converter Test 1</h3>
                     please insert "hello world" into the input field
@@ -48,6 +49,7 @@
                         <grv:testValidator1/>
                     </h:inputText>
                 </h:panelGroup>
+                -->
                 <h:panelGroup styleClass="stdBox">
                     <h3>Action Test 1</h3>
                     <h:commandButton value="Press me dynamic" action="#{testbean.doit}"/>
diff --git a/extscript-examples/myfaces20-example/src/main/webapp/javablog.xhtml b/extscript-examples/myfaces20-example/src/main/webapp/javablog.xhtml
index 4d9c119..820805f 100644
--- a/extscript-examples/myfaces20-example/src/main/webapp/javablog.xhtml
+++ b/extscript-examples/myfaces20-example/src/main/webapp/javablog.xhtml
@@ -41,7 +41,7 @@
                     </h:panelGrid>
                     <hr/>
                     <h:commandButton styleClass="btn" action="#{javaBlogView.addEntry}" value="Add Blog Entry">
-                        <f:ajax execute="@this" render="content"/>
+                        <f:ajax execute="@form" render="content"/>
                     </h:commandButton>
                 </h:panelGrid>
             </div>
diff --git a/extscript-examples/pom.xml b/extscript-examples/pom.xml
index 0b16245..264c31b 100644
--- a/extscript-examples/pom.xml
+++ b/extscript-examples/pom.xml
@@ -49,6 +49,7 @@
         <module>spring-example</module>
     </modules>
 
+    
 
 
     <profiles>
diff --git a/pom.xml b/pom.xml
index 1f054a7..6bae630 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,8 +11,9 @@
     
     <properties>
         <myfaces12.version>1.2.8</myfaces12.version>
-        <myfaces2.version>2.0.0-SNAPSHOT</myfaces2.version>
+        <myfaces2.version>2.0.0</myfaces2.version>
         <groovy.version>1.7.1</groovy.version>
+        <extval.version>2.0.4-SNAPSHOT</extval.version>
     </properties>
 
     <description>
@@ -64,27 +65,7 @@
                 <enabled>false</enabled>
             </snapshots>
         </repository>
-        <repository>
-            <releases>
-                <enabled>false</enabled>
-            </releases>
-            <snapshots>
-                <enabled>true</enabled>
-            </snapshots>
-            <id>apache-maven-snapshots</id>
-            <url>http://people.apache.org/repo/m2-snapshot-repository</url>
-        </repository>
-        <repository>
-            <id>myfaces2beta3</id>
-            <url>http://people.apache.org/~lu4242/myfaces200beta3/</url>
-            <releases>
-                <enabled>true</enabled>
-            </releases>
-            <snapshots>
-                <enabled>false</enabled>
-            </snapshots>
-        </repository>
-
+        
     </repositories>
 
     <dependencies>
@@ -214,10 +195,11 @@
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>jxr-maven-plugin</artifactId>
+                <!--
                 <configuration>
                     <aggregate>true</aggregate>
                 </configuration>
-
+                -->
             </plugin>
 
             <plugin>
@@ -232,10 +214,7 @@
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>surefire-report-maven-plugin</artifactId>
-                <configuration>
-                    <parallel>classes</parallel>
-                    <threadCount>4</threadCount>
-                </configuration>
+                
             </plugin>
 
             <plugin>