2

我是 GWT 和 PlayN 的新手。遵循 PlayN wiki 中的两个安装指南,让 PlayN 在 Eclipse 中工作:BeginnerInstallationGuideGettingStarted。我可以运行showcase-java 项目,但是showcase-html 版本在编译过程中出现问题,说它找不到验证jar。这是 GWT 编译器的输出:

Compiling module playn.showcase.Showcase
Resolving com.google.gwt.validation.client.constraints.AbstractDecimalMaxValidator
      Found type 'com.google.gwt.validation.client.constraints.AbstractDecimalMaxValidator'
         Found type 'javax.validation.constraints.DecimalMax'
            [WARN] Detected warnings related to 'javax.validation.Constraint'.   Is validation-< version>.jar on the classpath?
            Specify -logLevel DEBUG to see all errors.
            [WARN] Ignoring unresolvable annotation type javax.validation.Constraint
   Compiling 1 permutation
      Compiling permutation 0...
   Compile of permutations succeeded
Linking into C:\Users\Jo\playn-samples\showcase\html\target\playn-showcase-html-1.0-SNAPSHOT\showcase
   Link succeeded
   Compilation succeeded -- 62.900s

将不胜感激任何帮助!

4

2 回答 2

1

我没有答案,但也许尝试清理并重新构建项目“playn-showcase”。

还尝试为项目“playn-showcase”(明确不是“playn-shocase-html”)运行“mvn package”(在 Eclipse 中:Run as... / Maven build... with target 'package')。

此过程可能会创建缺少的 jar 'playn-showcase-html-1.0-SNAPSHOT.jar'。

于 2012-01-31T09:26:41.230 回答
1

如果它们尚不存在,请尝试将以下依赖项添加到showcase-html pom.xml...

<dependencies>

  ...

  <!-- not really needed, but will suppress errors during GWT compilation -->
  <dependency>
    <groupId>javax.validation</groupId>
    <artifactId>validation-api</artifactId>
    <version>1.0.0.GA</version>
    <scope>provided</scope>
  </dependency>

  <dependency>
    <groupId>javax.validation</groupId>
    <artifactId>validation-api</artifactId>
    <version>1.0.0.GA</version>
    <classifier>sources</classifier>
    <scope>provided</scope>
  </dependency>

  ...

</dependencies>
于 2012-02-01T19:49:13.183 回答