Index: lucene/common-build.xml
===================================================================
--- lucene/common-build.xml	(revision 1388725)
+++ lucene/common-build.xml	(working copy)
@@ -1750,9 +1750,19 @@
     </sequential>
   </macrodef>
   
+  <target name="resolve-rhino" unless="rhino.loaded" depends="ivy-availability-check,ivy-fail,ivy-configure">
+    <!-- depend on this target before using any "script" tag with javascript 
+         to ensure that the rhino.classpath is setup and javascript is available
+    -->
+    <ivy:cachepath organisation="rhino" module="js" revision="1.7R2"
+                   inline="true" conf="default" type="jar" transitive="true" 
+                   pathid="rhino.classpath"/>
+    <property name="rhino.loaded" value="true"/>
+  </target>
+
   <!-- PEGDOWN macro: Before using depend on the target "resolve-pegdown" -->
   
-  <target name="resolve-pegdown" unless="pegdown.loaded" depends="ivy-availability-check,ivy-fail,ivy-configure">
+  <target name="resolve-pegdown" unless="pegdown.loaded" depends="ivy-availability-check,ivy-fail,ivy-configure,resolve-rhino">
     <ivy:cachepath organisation="org.pegdown" module="pegdown" revision="1.1.0"
       inline="true" conf="default" type="jar" transitive="true" pathid="pegdown.classpath"/>
     <property name="pegdown.loaded" value="true"/>
@@ -1771,7 +1781,12 @@
           <tokenfilter>
             <filetokenizer/>
             <replaceregex pattern="\b(LUCENE|SOLR)\-\d+\b" replace="[\0](https://issues.apache.org/jira/browse/\0)" flags="gs"/>
-            <scriptfilter language="javascript" classpathref="pegdown.classpath"><![CDATA[
+            <scriptfilter language="javascript">
+              <classpath>
+                <path refid="pegdown.classpath" />
+                <path refid="rhino.classpath" />
+              </classpath>
+              <![CDATA[
               importClass(java.lang.StringBuilder);
               importClass(org.pegdown.PegDownProcessor);
               importClass(org.pegdown.Extensions);
Index: solr/common-build.xml
===================================================================
--- solr/common-build.xml	(revision 1388725)
+++ solr/common-build.xml	(working copy)
@@ -275,8 +275,8 @@
     </sequential>
   </macrodef>
 
-  <target name="define-lucene-javadoc-url" unless="lucene.javadoc.url">
-    <script language="javascript"><![CDATA[
+  <target name="define-lucene-javadoc-url" depends="resolve-rhino" unless="lucene.javadoc.url">
+    <script language="javascript" classpathref="rhino.classpath"><![CDATA[
       var url, version = project.getProperty('version');
       if (version.contains('-SNAPSHOT')) {
         importClass(java.io.File);
