问题开始春天roo

时间:2011-03-06 20:54:13

标签: maven spring-roo

我刚刚开始使用Spring Roo,并遵循tutorial 我在运行

时遇到以下错误
roo> perform tests

我已经在我的电脑上安装了maven2.2.1。

[Thread-8] 8701K downloaded (aspectjtools-1.6.11.M2.jar)
[Thread-8] [INFO] [aspectj:compile {execution: default}]
[Thread-8] [ERROR] The import com.google.appengine cannot be resolved
[Thread-8] [ERROR] UserService cannot be resolved to a type
[Thread-8] [ERROR] UserServiceFactory cannot be resolved
[Thread-8] [ERROR] User cannot be resolved to a type
[Thread-8] [ERROR] The import com.google.appengine cannot be resolved
[Thread-8] [ERROR] UserService cannot be resolved to a type
[Thread-8] [ERROR] UserServiceFactory cannot be resolved
[Thread-8] [ERROR] The import com.google.appengine cannot be resolved
[Thread-8] [ERROR] User cannot be resolved to a type
[Thread-8] [WARNING] advice defined in org.springframework.scheduling.aspectj.Ab
stractAsyncExecutionAspect has not been applied [Xlint:adviceDidNotMatch]
[Thread-8] [WARNING] advice defined in org.springframework.mock.staticmock.Annot
ationDrivenStaticEntityMockingControl has not been applied [Xlint:adviceDidNotMa
tch]
[Thread-8] [WARNING] advice defined in org.springframework.mock.staticmock.Abstr
actMethodMockingControl has not been applied [Xlint:adviceDidNotMatch]
[Thread-8] [INFO] --------------------------------------------------------------
----------
[Thread-8] [ERROR] BUILD ERROR
[Thread-8] [INFO] --------------------------------------------------------------
----------
[Thread-8] [INFO] Compiler errors :
[Thread-8] error at import com.google.appengine.api.users.User;
[Thread-8] ^^^^^^^^^^^^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\UserServiceLocator.java:3:0::0 The import com.google.appengine cannot be
resolved
[Thread-8] error at import com.google.appengine.api.users.UserService;
[Thread-8] ^^^^^^^^^^^^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\UserServiceLocator.java:4:0::0 The import com.google.appengine cannot be
resolved
[Thread-8] error at import com.google.appengine.api.users.UserServiceFactory;
[Thread-8] ^^^^^^^^^^^^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\UserServiceLocator.java:5:0::0 The import com.google.appengine cannot be
resolved
[Thread-8] error at final UserService service = UserServiceFactory.getUserServic
e();
[Thread-8] ^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\UserServiceLocator.java:13:0::0 UserService cannot be resolved to a type
[Thread-8] error at final UserService service = UserServiceFactory.getUserServic
e();
[Thread-8] ^^^^^^^^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\UserServiceLocator.java:13:0::0 UserServiceFactory cannot be resolved
[Thread-8] error at public User getCurrentUser() {
[Thread-8]
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\UserServiceLocator.java:24:0::0 User cannot be resolved to a type
[Thread-8] error at import com.google.appengine.api.users.UserService;
[Thread-8] ^^^^^^^^^^^^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\GaeAuthFilter.java:3:0::0 The import com.google.appengine cannot be resol
ved
[Thread-8] error at import com.google.appengine.api.users.UserServiceFactory;
[Thread-8] ^^^^^^^^^^^^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\GaeAuthFilter.java:4:0::0 The import com.google.appengine cannot be resol
ved
[Thread-8] error at UserService userService = UserServiceFactory.getUserService(
);
[Thread-8] ^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\GaeAuthFilter.java:21:0::0 UserService cannot be resolved to a type
[Thread-8] error at UserService userService = UserServiceFactory.getUserService(
);
[Thread-8] ^^^^^^^^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\GaeAuthFilter.java:21:0::0 UserServiceFactory cannot be resolved
[Thread-8] error at import com.google.appengine.api.users.User;
[Thread-8] ^^^^^^^^^^^^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\UserServiceWrapper.java:3:0::0 The import com.google.appengine cannot be
resolved
[Thread-8] error at public User getCurrentUser();
[Thread-8] ^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\UserServiceWrapper.java:16:0::0 User cannot be resolved to a type
[Thread-8]
[Thread-8] [INFO] --------------------------------------------------------------
----------
[Thread-8] [INFO] For more information, run Maven with the -e switch
[Thread-8] [INFO] --------------------------------------------------------------
----------
[Thread-8] [INFO] Total time: 20 minutes 53 seconds
[Thread-8] [INFO] Finished at: Sun Mar 06 18:33:34 CET 2011
[Thread-8] [INFO] Final Memory: 26M/64M
[Thread-8] [INFO] --------------------------------------------------------------
----------

命令'mvn.bat test'未成功完成

roo>

然后我尝试执行

roo> perform tests

导入eclipse时,我遇到了这个错误:

Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.0:compile (default) on project foo: Execution default of goal org.codehaus.mojo:aspectj-maven-plugin:1.0:compile failed: Plugin org.codehaus.mojo:aspectj-maven-plugin:1.0 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:1.4.2 at specified path C:\Program Files\Java\jre6/../lib/tools.jar -> [Help 1]

任何帮助都会感激不尽。

修改
根据你的建议,我意识到问题出现在maven-eclipse-plugin-2.8.jar

正在运行

  

roo>执行eclipse
  命令mvn.bat eclipse:clean eclipse:eclipse未成功完成

所以我决定运行它appart,检查原因,我面对:

未找到所需目标:eclipse:org.apache.maven.plugin中的eclipse:maven-eclipse-plugin-2.8.jar

但是我去了指定的文件夹,而jar就在那里,可能是什么问题?

的.m2 \库\组织\阿帕奇\行家\插件\行家-Eclipse的插件\ 2.8 \行家-Eclipse的插件-2.8.jar

使用另一个没有成功完成的命令做类似的事情

  

mvn.bat测试

我面对另一个错误:

无法执行:mojo。它需要一个带有现有pom.xml的项目,但构建不使用一个

也许在这个secon错误中是线索。如何创建一个pom.xml ???

4 个答案:

答案 0 :(得分:2)

我遇到了同样的问题 - 尝试了两件似乎让它起作用的事情。

  1. 解压缩并再次设置Roo。如果您在Roo启动时看到“未知版本”,请执行此操作。

  2. 这个似乎解决了这个问题。检查您当地的maven回购。导航到应下载codehaus jar的位置。删除lastUpdated文件并清除该文件夹。更新Maven依赖项或再次运行Roo命令。确保您能够连接到远程maven仓库。

  3. 希望有所帮助。让我知道它是怎么回事。

答案 1 :(得分:1)

是的,这也让我大惊小怪。它们似乎是一个简单的文档错误:

http://empire5.com/development/spring-roo-1-1-2-hangup/

答案 2 :(得分:1)

经过大量的搜索,最后我发现问题导致了这个问题。 它与aspectj插件中配置的工具jar的路径有关(在.m2 repo中) There是一个类似的问题,我提供了更多详细信息。

答案 3 :(得分:0)

我有一段时间经历过这些类型的问题。我有我的JAVA_HOME和路径指向较旧的JDK,这导致我的问题。