Cherry picking r9594, r9630 into releases/2.2, fix gwt-servlet dep in samples/expenses/pom.xml


git-svn-id: https://google-web-toolkit.googlecode.com/svn/releases/2.2@9632 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/samples/expenses/pom.xml b/samples/expenses/pom.xml
index 46396ef..4ae585b 100644
--- a/samples/expenses/pom.xml
+++ b/samples/expenses/pom.xml
@@ -623,7 +623,12 @@
             <artifactId>gwt-dev</artifactId>
             <version>${gwt.version}</version>
           </dependency>
-        </dependencies>
+          <dependency>
+            <groupId>com.google.gwt</groupId>
+            <artifactId>gwt-servlet</artifactId>
+            <version>${gwt.version}</version>
+          </dependency>
+       </dependencies>
         <configuration>
           <logLevel>INFO</logLevel>
           <style>PRETTY</style>
diff --git a/tools/scripts/maven_script.sh b/tools/scripts/maven_script.sh
index 19f5f5e..2d3a615 100755
--- a/tools/scripts/maven_script.sh
+++ b/tools/scripts/maven_script.sh
@@ -14,15 +14,17 @@
 # License for the specific language governing permissions and limitations under
 # the License.
 
-# This script should be run from the trunk dir.
-echo Did you remember to run ant clean dist-dev
+MAVEN_REPO=${MAVEN_REPO:-"~/.m2/repository"}
+GWT_VERSION=${GWT_VERSION:-"2.2-rc1"}
+GWT_DIR=${GWT_DIR:-"build/lib"}
 
-MAVEN_REPO=~/.m2/repository
+echo "Pushing GWT jars from ${GWT_DIR} into local maven repo with version ${GWT_VERSION}."
+echo "Customize by setting GWT_DIR and GWT_VERSION."
 
 for i in dev user servlet
 do
-   mvn install:install-file -DgroupId=com.google.gwt -DartifactId=gwt-${i} -Dversion=2.1.1 -Dpackaging=jar -Dfile=build/lib/gwt-${i}.jar -DgeneratePom=true
+   mvn install:install-file -DgroupId=com.google.gwt -DartifactId=gwt-${i} -Dversion=${GWT_VERSION} -Dpackaging=jar -Dfile=${GWT_DIR}/gwt-${i}.jar -DgeneratePom=true
 done 
 touch /tmp/empty-fake-soyc-vis.jar
-mvn install:install-file -DgroupId=com.google.gwt -DartifactId=gwt-soyc-vis -Dversion=2.1.1 -Dpackaging=jar -DgeneratePom=true -Dfile=/tmp/empty-fake-soyc-vis.jar
+mvn install:install-file -DgroupId=com.google.gwt -DartifactId=gwt-soyc-vis -Dversion=${GWT_VERSION} -Dpackaging=jar -DgeneratePom=true -Dfile=/tmp/empty-fake-soyc-vis.jar
 echo "installed the gwt libs in the maven repo"