2014-05-19 26 views
1

我使用該命令來構建道場1.9.3無法建立道場1.9.3

螞蟻-file buildWAR.xml -DbuildWorkDir = G:\基本代碼\文件夾\ 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> 

任何人都知道這個錯誤,請幫忙。

問候

+0

不確定這是否是問題,但在文件路徑中有'/'和'\'的組合,這可能值得修復。 – Bucket

+0

我編譯這與dojo1.3.1,然後這工作正常,但是當我用dojo1.9.3編譯它不起作用:( –

回答

2

我正經歷着類似的問題,經過一番調查我意識到,問題是,我已經忽略了一個新人打造道場構建所需的目錄。

在我的特殊情況下,這個問題與忽略(刪除)sdk的util/build目錄有關。

您可以通過添加調試此:

console.log(url); 

dojo/_base/configRhino.js在isLocal功能。

這個函數確定一個文件是本地文件還是一個URL文件,如果該文件不存在,那麼它假定這是一個URL,然後發生異常。

多餘的行將打印所有正在嘗試使用的文件,以及何時打印出的最後一個文件路徑是錯誤的。

這一切當然只是根據我的經驗猜測。

+0

謝謝你的回覆,我已經解決了這個問題,我也有同樣的問題,即缺少util /建立文件夾,但感謝您的回覆:) –