无法构建dojo 1.9.3

时间:2014-05-19 12:49:46

标签: dojo

我正在使用此命令来构建dojo 1.9.3

" ant -file buildWAR.xml -DbuildWorkDir = G:\ Codebase \ folder \ PSInviter -DzuoraJarFile = WebContent \ WEB-INF \ lib \ zuora.jar"

但是由于这种反应,我收到以下错误:

[exec] G:\Codebase\folder\PSInviter\WebContent\js\dojo-release-1.9.3-src\util\ buildscripts>java -Xms256m -Xmx256m  -cp    "           G:\Codebase\folder\PSInviter\WebContent\js\dojo-release-1.9.3-src\uti
l\buildscripts\../shrinksafe/js.jar";"G:\Codebase\folder\
PSInviter\WebContent\js\dojo-release-1.9.3-src\util\buildscripts\../closureCompi
ler/compiler.jar";"G:\Codebase\folder\PSInviter\WebConten
t\js\dojo-release-1.9.3-src\util\buildscripts\../shrinksafe/shrinksafe.jar" org.
mozilla.javascript.tools.shell.Main  "G:\Codebase\folder\
PSInviter\WebContent\js\dojo-release-1.9.3-src\util\buildscripts\../../dojo/dojo
.js" baseUrl="G:\Codebase\folder\PSInviter\WebContent\js\
dojo-release-1.9.3-src\util\buildscripts\../../dojo" load=build      releaseDir=G:\Codebase\folder\PSInviter\WebContent\js\builds/ profileFile
=G:\Codebase\folder\PSInviter/WebContent/js/somefolder
/timedriver.profile.js copyTests=false action=clean,release optimize=shrinksafe
localeList=ar,ca,cs,da,de,de-de,el,en,en-au,en-ca,en-gb,en-us,es,es-es,fi,fr,he,
hu,it,it-it,ja,ja-jp,ko,ko-kr,nb,nl,pl,pt,pt-br,ru,sk,sl,sv,th,tr,zh,zh-cn,zh-tw
releaseName=1405191028 internStrings=true cssOptimize=comments excludeFromBase=
true
[exec] org.mozilla.javascript.WrappedException: Wrapped java.net.MalformedURLException: unknown protocol: g
下面的

是我的buildWar.xml文件的代码

    <?xml version="1.0"?>

   <!-- Build the PSInviter WAR project -->
   <project name="PSInviter.WAR" basedir="." default="default">

   <!-- All properties are in build.properties -->
   <property environment="env" /> 
   <property file="buildWAR.properties" />
   <property name="dojoSrcRelease" location="WebContent/js/dojo-release-1.9.3-src" />
   <property name="outputDir" location="WebContent/js/builds" />

   <path id="compile.classpath">
    <pathelement path="${classes.dir}" />
    <fileset dir="${was.api.dir}" includes="runtimes/websphere_apis.jar" />
    <fileset dir="${was.api.dir}" includes="java/jre/lib/**/*.jar" />
    <fileset dir="${lib.dir}" includes="**/*.jar" />
   </path>

   <target name="init" description="Initialize the build process">
    <delete dir="${build.dir}/js/builds"/>
    <mkdir dir="${build.dir}/js/builds"/>
    <delete dir="${outputDir}"/>
    <mkdir dir="${outputDir}"/>
    <mkdir dir="${temp.artifacts.dir}"/>
    <tstamp>
        <format property="buildDateTime" pattern="yyMMddHHmm"/>
    </tstamp>
   </target>

   <target name="build-dojo" description="" depends="init">

        <exec dir="${dojoSrcRelease}/util/buildscripts/" executable="${dojoSrcRelease}/util/buildscripts/build.bat">
            <arg line="releaseDir=&quot;${outputDir}/&quot;"/>
            <arg line="profileFile=&quot;${basedir}/WebContent/js/someFolder/timedriver.profile.js&quot;"/>
            <arg line="copyTests=false"/>
            <arg line="action=clean,release"/>
            <arg line="optimize=shrinksafe"/>
            <arg line="localeList=ar,ca,cs,da,de,de-de,el,en,en-au,en-ca,en-gb,en-us,es,es-es,fi,fr,he,hu,it,it-it,ja,ja-jp,ko,ko-kr,nb,nl,pl,pt,pt-br,ru,sk,sl,sv,th,tr,zh,zh-cn,zh-tw"/>
            <arg line="releaseName=${buildDateTime}" />
            <arg line="internStrings=true" />
            <arg line="cssOptimize=comments" />
            <arg line="excludeFromBase=true" />

        </exec>

        <replaceregexp file="${basedir}/WebContent/WEB-INF/startup.properties"
                         match="TDBuildNumber=(.*)"
                         replace="TDBuildNumber=${buildDateTime}"
                         byline="true"/>

        <java dir="WebContent/js" classname="org.mozilla.javascript.tools.shell.Main" fork="true">
            <arg value="nonDojo/nonDojoBuilder.js"/>
            <arg value="nonDojo/base.js|nonDojo/login.js|nonDojo/securityPolicy.js|nonDojo/MD5.js|jsonrpc.js|nonDojo/loginpage.js"/>
            <arg value="${outputDir}/${buildDateTime}/loginPage.js"/>
            <classpath>
                <pathelement location="${exec.dir}/../WebContent/WEB-INF/lib/js.jar"/>
                <pathelement location="${exec.dir}/../WebContent/WEB-INF/lib/shrinksafe.jar"/>
            </classpath>
        </java>

        <java dir="WebContent/js" classname="org.mozilla.javascript.tools.shell.Main" fork="true">
            <arg value="nonDojo/nonDojoBuilder.js"/>
            <arg value="nonDojo/base.js|nonDojo/login.js|nonDojo/sfdclanding.js|nonDojo/securityPolicy.js|nonDojo/MD5.js|jsonrpc.js|nonDojo/registration.js"/>
            <arg value="${outputDir}/${buildDateTime}/sfdclandingPage.js"/>
            <classpath>
                <pathelement location="${exec.dir}/../WebContent/WEB-INF/lib/js.jar"/>
                <pathelement location="${exec.dir}/../WebContent/WEB-INF/lib/shrinksafe.jar"/>
            </classpath>
        </java>

        <copy file="${basedir}/WebContent/js/jsonrpc.js" todir="${outputDir}/${buildDateTime}" />
        <copy file="${basedir}/WebContent/js/nonDojo/securityPolicy.js" todir="${outputDir}/${buildDateTime}" />

    </target>

  <target name="copy-files" depends="build-dojo" description="Copy the web content files">
    <copy todir="${build.dir}">
      <fileset dir="${web.dir}">
        <exclude name="**/.svn"/>
        <exclude name="**/js/dojo*/**"/>
        <exclude name="**/js/someFolder/**"/>
      </fileset>
    </copy>
    <copy todir="${build.dir}/AST" failonerror="true">
          <fileset dir="AST">
            <exclude name="**/.svn"/>
          </fileset>
    </copy>
    <copy todir="${build.dir}/WEB-INF/lib" failonerror="true" file="${zuoraJarFile}" overwrite="true" />
  </target>

  <target name="compile" depends="copy-files" description="Compile the Java source code">
    <mkdir dir="${classes.dir}"/>
    <javac srcdir="${src.dir}"
           destdir="${classes.dir}"
           includes="**/*.java"
           classpathref="compile.classpath"
           source="${javac.source}"
           target="${javac.target}"
           debug="${javac.debug}"
           fork="true"
           includeAntRuntime="no"
    />  
  </target>

  <target name="war" depends="compile" description="Create the WAR file">
    <manifest file="MANIFEST.MF">
        <attribute name="Build-Version" value="${buildVersion} - ${buildDateTime}"/>
    </manifest>
    <delete dir="${build.dir}/AST"/>
    <mkdir dir="target"/>
    <war destfile="target/${war.file}" 
         webxml="${web-inf.dir}/web.xml"
         basedir="${build.dir}"
         manifest="MANIFEST.MF"
    />
    <copy todir="${temp.artifacts.dir}" failonerror="true">
          <fileset dir="target">
            <exclude name="**/.svn"/>
            <include name="${war.file}"/>
          </fileset>
    </copy>
  </target> 


  <target name="jar" depends="compile" description="Create the timedriver jar file">
    <jar destfile="target/${jar.file}"
       basedir="${classes.dir}"
    />
    <copy todir="${temp.artifacts.dir}" overwrite="true" failonerror="true">
          <fileset dir="target">
            <exclude name="**/.svn"/>
            <include name="${jar.file}"/>
          </fileset>
    </copy>
  </target> 

  <target name="default" depends="war, jar" />

</project>

任何人都知道这个错误,请帮助。

此致

1 个答案:

答案 0 :(得分:2)

我遇到了类似的问题,经过一些调查后我发现问题是我忽略了创建dojo构建所需的几个目录。

在我的特定情况下,问题与忽略(删除)sdk的util / build目录有关。

您可以通过添加以下内容来调试:

console.log(url);

isLocal函数的dojo/_base/configRhino.js

此函数确定文件是本地文件还是URL,如果文件不存在,则假定该文件是URL,然后发生异常。

该额外的行将打印所有尝试使用的文件,并且当它打破最后打印的文件路径时是错误的。

所有这些当然只是根据我的经验猜测。