这是我第一次尝试在 Windows 命令行中编写脚本。我正在尝试使用变量来使我要编写的命令更易于阅读。不幸的是,我无法让脚本正常工作,并且 Pause_ 没有保持 cmd 窗口打开,因此我可能会看到出了什么问题。以下是我到目前为止编写的脚本。
@echo off
:: Script for generating java classes from xsd using jibx
::
:: Create variables for the different paths for easy editing later
set jibx = ../../Libraries/jibx/lib/jibx-tools.jar
set CodeGen = org.jibx.schema.codegen.CodeGen
set package = src/com/TersoSolutions/Jetstream/SDK/
set source = resources/xsd/
set binding = resources/bindings/
::
::
:: First Command
java -cp %jibx% %CodeGen% -b %binding%GetConfigurationResponse.xml -p %package%Application/Model/GetConfigurationResponse %source%Application/1.1/GetConfigurationResponse.xsd
::
:: Repeat the command
java -cp %jibx% %CodeGen% -b %binding%GetConfigurationResponse2.xml -p %package%Application/Model/GetConfigurationResponse2 %source%Application/1.1/GetConfigurationResponse.xsd
::
Pause_
目的是以类似的方式重复该命令,以验证我是否能够以列出我需要完成的所有操作的方式编写脚本。
编辑:
我试图在脚本中复制的命令直接在命令行中工作,如下所示
java -cp ../../Libraries/jibx/lib/jibx-tools.jar org.jibx.schema.codegen.CodeGen -b /resources/bindings/GetConfigurationResponse.xml -p com.TersoSolutions.JetStream.SDK.Application.Model.GetConfigurationResponse /resources/xsd/Applicationi/1.1/GetConfigurationResponse.xsd