2016-05-27 4 views
0

ダウンロードのために利用できず、新しい2.0.0.M2バージョンを試してみましたが、pizzashopサンプルを実行しましたが、このエラーを得春Rooの2.0.0.M2発行pizzashopサンプル問題2 - オプション「クラス」は、このコマンド

field string --fieldName shopCountry --class ~.domain.PizzaOrderPk 
Option 'class' is not available for this command when the focus is set to one class. 

コードのサンプルディレクトリからではなく、最初の行をコメント付き:

// tailor activate --name web-simple 
// Create a new project 
project setup --topLevelPackage com.springsource.pizzashop --projectName pizzashop 

// Setup JPA persistence using EclipseLink and H2 
jpa setup --provider ECLIPSELINK --database H2_IN_MEMORY 

// Create domain entities 
entity jpa --class ~.domain.Base --testAutomatically 
field string --fieldName name --sizeMin 2 --notNull 

entity jpa --class ~.domain.Topping --testAutomatically 
field string --fieldName name --sizeMin 2 --notNull 

entity jpa --class ~.domain.Pizza --testAutomatically 
field string --fieldName name --notNull --sizeMin 2 
field number --fieldName price --type java.math.BigDecimal 
field set --fieldName toppings --type ~.domain.Topping 
field reference --fieldName base --type ~.domain.Base 

entity jpa --class ~.domain.PizzaOrder --testAutomatically --identifierType ~.domain.PizzaOrderPk 
field string --fieldName name --notNull --sizeMin 2 
field string --fieldName address --sizeMax 30 
field number --fieldName total --type java.math.BigDecimal 
field date --fieldName deliveryDate --type java.util.Date 
field set --fieldName pizzas --type ~.domain.Pizza 

field string --fieldName shopCountry --class ~.domain.PizzaOrderPk 
field string --fieldName shopCity 
field string --fieldName shopName 

// Define a repository layer for persistence 
repository jpa --interface ~.repository.ToppingRepository --entity ~.domain.Topping 
repository jpa --interface ~.repository.BaseRepository --entity ~.domain.Base 
repository jpa --interface ~.repository.PizzaRepository --entity ~.domain.Pizza 
repository jpa --interface ~.repository.PizzaOrderRepository --entity ~.domain.PizzaOrder 

// Define a service/facade layer 
service type --interface ~.service.ToppingService --entity ~.domain.Topping 
service type --interface ~.service.BaseService --entity ~.domain.Base 
service type --interface ~.service.PizzaService --entity ~.domain.Pizza 
service type --interface ~.service.PizzaOrderService --entity ~.domain.PizzaOrder 

// Offer JSON remoting for all domain types through Spring MVC 
json all --deepSerialize 
web mvc json setup 
web mvc json all --package ~.web 

web mvc setup 
web mvc all --package ~.web 

// Example scripts for JSON remoting: 
// curl -i -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{name: "Thin Crust"}' http://localhost:8080/pizzashop/bases 
// curl -i -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '[{name: "Cheesy Crust"},{name: "Thick Crust"}]' http://localhost:8080/pizzashop/bases/jsonArray 
// curl -i -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '[{name: "Fresh Tomato"},{name: "Prawns"},{name: "Mozarella"},{name: "Bogus"}]' http://localhost:8080/pizzashop/toppings/jsonArray 
// curl -i -X DELETE -H "Accept: application/json" http://localhost:8080/pizzashop/toppings/7 
// curl -i -X PUT -H "Content-Type: application/json" -H "Accept: application/json" -d '{id:6,name:"Mozzarella",version:1}' http://localhost:8080/pizzashop/toppings 
// curl -i -H "Accept: application/json" http://localhost:8080/pizzashop/toppings 
// curl -i -H "Accept: application/json" http://localhost:8080/pizzashop/toppings/6 
// curl -i -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{name:"Napolitana",price:7.5,base:{id:1},toppings:[{name: "Anchovy fillets"},{name: "Mozzarella"}]}' http://localhost:8080/pizzashop/pizzas 
// curl -i -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{name:"Stefan",total:7.5,address:"Sydney, AU",deliveryDate:1314595427866,id:{shopCountry:"AU",shopCity:"Sydney",shopName:"Pizza Pan 1"},pizzas:[{id:8,version:1}]}' http://localhost:8080/pizzashop/pizzaorders 

これはになります:

D:\Source\Test\Pizza 
λ \Tools\spring-roo-2.0.0.M2\bin\roo.bat 
    ____ ____ ____ 
/__ \/ __ \/ __ \ 
//_////////
/_, _/ /_///_//
/_/ |_|\____/\____/ 2.0.0.M2 [rev 003b42c] 


Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER. 
Spring Roo Eastern Grey UI started at 'http://localhost:9191/' 
roo> script --file pizzashop.roo 
// tailor activate --name web-simple 
// Create a new project 
project setup --topLevelPackage com.springsource.pizzashop --projectName pizzashop 
Created ROOT\pom.xml 
Created SRC_MAIN_RESOURCES 
Created SRC_MAIN_JAVA\com\springsource\pizzashop 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\PizzashopApplication.java 
Created SRC_MAIN_RESOURCES\banner.txt 

// Setup JPA persistence using EclipseLink and H2 
jpa setup --provider ECLIPSELINK --database H2_IN_MEMORY 
Created SRC_MAIN_RESOURCES\application.properties 
Updated ROOT\pom.xml [added dependencies org.springframework.boot:spring-boot-starter-data-jpa:, com.h2database:h2:] 

// Create domain entities 
entity jpa --class ~.domain.Base --testAutomatically 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Base.java 
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain 
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\BaseDataOnDemand.java 
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\BaseIntegrationTest.java 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Base_Roo_Jpa_Entity.aj 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Base_Roo_ToString.aj 
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\BaseIntegrationTest_Roo_Configurable.aj 
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\BaseDataOnDemand_Roo_Configurable.aj 
field string --fieldName name --sizeMin 2 --notNull 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Base.java 
Updated ROOT\pom.xml [added dependency javax.validation:validation-api:null] 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Base_Roo_JavaBean.aj 

entity jpa --class ~.domain.Topping --testAutomatically 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Topping.java 
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\ToppingDataOnDemand.java 
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\ToppingIntegrationTest.java 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Topping_Roo_Jpa_Entity.aj 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Topping_Roo_ToString.aj 
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\ToppingIntegrationTest_Roo_Configurable.aj 
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\ToppingDataOnDemand_Roo_Configurable.aj 
field string --fieldName name --sizeMin 2 --notNull 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Topping.java 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Topping_Roo_JavaBean.aj 

entity jpa --class ~.domain.Pizza --testAutomatically 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza.java 
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\PizzaDataOnDemand.java 
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\PizzaIntegrationTest.java 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza_Roo_Jpa_Entity.aj 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza_Roo_ToString.aj 
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\PizzaIntegrationTest_Roo_Configurable.aj 
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\PizzaDataOnDemand_Roo_Configurable.aj 
field string --fieldName name --notNull --sizeMin 2 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza.java 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza_Roo_JavaBean.aj 
field number --fieldName price --type java.math.BigDecimal 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza.java 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza_Roo_JavaBean.aj 
field set --fieldName toppings --type ~.domain.Topping 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza.java 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza_Roo_JavaBean.aj 
field reference --fieldName base --type ~.domain.Base 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza.java 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza_Roo_JavaBean.aj 

entity jpa --class ~.domain.PizzaOrder --testAutomatically --identifierType ~.domain.PizzaOrderPk 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder.java 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrderPk.java 
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\PizzaOrderDataOnDemand.java 
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\PizzaOrderIntegrationTest.java 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder_Roo_Jpa_Entity.aj 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder_Roo_ToString.aj 
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\PizzaOrderDataOnDemand_Roo_Configurable.aj 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrderPk_Roo_Configurable.aj 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrderPk_Roo_Serializable.aj 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrderPk_Roo_Identifier.aj 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrderPk_Roo_Equals.aj 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrderPk_Roo_ToString.aj 
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\PizzaOrderIntegrationTest_Roo_Configurable.aj 
field string --fieldName name --notNull --sizeMin 2 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder.java 
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder_Roo_JavaBean.aj 
field string --fieldName address --sizeMax 30 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder.java 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder_Roo_JavaBean.aj 
field number --fieldName total --type java.math.BigDecimal 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder.java 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder_Roo_JavaBean.aj 
field date --fieldName deliveryDate --type java.util.Date 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder.java 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder_Roo_JavaBean.aj 
field set --fieldName pizzas --type ~.domain.Pizza 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder.java 
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder_Roo_JavaBean.aj 

field string --fieldName shopCountry --class ~.domain.PizzaOrderPk 
Option 'class' is not available for this command when the focus is set to one class. 
Script required 2.173 seconds to execute 
Script execution aborted 
~.domain.PizzaOrder roo> 

答えて

2

こんにちは、ありがとうございます。

私は、この質問に関連する新しい問題を、Spring Rooディストリビューションで提供される.rooスクリプトを確認するためのSpring Roo JIRA号トラッカーに作成しました。

https://jira.spring.io/browse/ROO-3752

春Rooの2.0.0.M2バージョンでは、あなたの質問に答える、フィールドのコマンドは、現在のエンティティとのDTOの将来の実装上で使用するために準備されています。フォーカスされたクラス、エンティティ、またはdtoのタイプに応じて、いくつかのコマンドパラメータが使用可能かどうかが決まります。したがって、ある種のクラスにすでに焦点を当てている場合は、--classパラメータを使用して別の異なるクラスを指定することができず、他のタイプに変更して無効なパラメータを使用しないようにすることができます。

しかし、これは対処する最良の方法ではない可能性がありますので、この動作を分析しています。回避策として、あなたはフィールドのコマンドを実行する前に集中クラスを変更するには、次のコマンドを実行することができ

focus --class ~.domain.PizzaOrderPk 

は、この情報がお役に立てば幸いです。

+0

この回答は、スクリプトの実行を続けるのに役立ちましたか?最高の答えを得るためのフィードバックを提供してください。よろしく。 – jcgarcia

関連する問題