0

これは、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
4

2 に答える 2

1

まず、Pause_する必要がありますPause

第 2 に、Setコマンドにスペースを使用しないでください。

スニペットをデバッグするにはecho、変数を設定してから試してください。

set binding = resources/bindings/
echo binding
>>>%binding%

set binding=resources/bindings/
echo binding
>>>resources/bindings/
于 2013-05-28T17:01:45.313 に答える
0

これを試して:

@echo オフセット&セットローカル
:: jibx を使用して xsd から Java クラスを生成するためのスクリプト
::
:: 後で簡単に編集できるように、さまざまなパスの変数を作成します
「jibx=../../Libraries/jibx/lib/jibx-tools.jar」を設定します
「CodeGen=org.jibx.schema.codegen.CodeGen」を設定します
「package=com.TersoSolutions.JetStream.SDK」を設定します。
「ソース=/リソース/xsd/」を設定します
「バインディング=/リソース/バインディング/」を設定します
::
::
:: 最初のコマンド
java -cp %jibx% %CodeGen% -b %binding%GetConfigurationResponse.xml -p %package%Application/Model/GetConfigurationResponse %source%Application/1.1/GetConfigurationResponse.xsd
:: コマンドを繰り返します  
java -cp %jibx% %CodeGen% -b %binding%GetConfigurationResponse.xml -p %package%Application/Model/GetConfigurationResponse %source%Application/1.1/GetConfigurationResponse.xsd
一時停止
于 2013-05-28T17:23:35.090 に答える