0

我正在尝试阅读本教程:

http://gwtsts.blogspot.sk/2011/03/part-ii-generating-gwt-project-using.html

因为我需要知道如何从现有数据库生成 GWT 前端(在我的例子中是 Postgre,但这个例子也会很好地为我服务)。

这是我执行的来自 Pizzashop.roo 的脚本:

project --topLevelPackage com.blogspot.gwtsts.pizzashop

persistence setup --provider DATANUCLEUS --database GOOGLE_APP_ENGINE --applicationId pizzashopexample

enum type --class ~.shared.PaymentType
enum constant --name CC_ONLINE
enum constant --name CASH_ON_DELIVERY
enum constant --name CC_ON_DELIVERY

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

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

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

entity jpa --class ~.server.domain.PizzaOrder --testAutomatically
field string --fieldName name --notNull --sizeMin 2
field string --fieldName address --sizeMax 30
field number --fieldName total --type java.lang.Float
field enum --fieldName paymentType --type ~.shared.PaymentType
field date --fieldName deliveryDate --type java.util.Date
field set --fieldName pizzas --type ~.server.domain.Pizza

gwt setup

logging setup --level INFO

整个脚本执行没有任何问题。但是当我运行命令时perform tests,它给了我以下错误消息(一些依赖项已成功下载,但构建失败并以错误结束):

[ERROR] Failed to execute goal org.datanucleus:maven-datanucleus-plugin:3.0.2:en
hance (default) on project pizzashop: Error executing DataNucleus tool org.datan
ucleus.enhancer.DataNucleusEnhancer: InvocationTargetException: Plugin (Bundle)
"org.datanucleus.enhancer" is already registered. Ensure you dont have multiple
JAR versions of the same plugin in the classpath. The URL "file:/C:/Users/jakub/
.m2/repository/org/datanucleus/datanucleus-enhancer/3.1.0-m2/datanucleus-enhance
r-3.1.0-m2.jar" is already registered, and you are trying to register an identic
al plugin located at URL "file:/C:/Users/jakub/.m2/repository/org/datanucleus/da
tanucleus-enhancer/3.0.1/datanucleus-enhancer-3.0.1.jar." -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception

我正在尝试在stackoverflow上找到的技巧来编辑datanucleus-core所在的pom.xml,并具体将标签添加<scope>runtime</scope>到datanucleus-core依赖项,但结果是一样的。

我正在使用 Windows 7 Ultimate 64 位。Spring Roo 1.2.2、apache maven 3.0.3、spring 工具套件 3.0.0、vfabric-tc-server-developer 2.7.1。我已经设置了所有系统环境变量(JAVA_HOME、spring roo、maven)。

非常感谢您的帮助 :)

我的 pom.xml: pom.xml

4

0 回答 0