我正在尝试使用 Maven 2(使用 M2M eclipse 插件)和 Tycho 自动构建我的 RCP 应用程序。
我的应用程序需要休眠以将数据保存在 SQLite 数据库中。为此,我将这些 XML 行放在pom.xml
需要 Hibernate 运行的插件中:
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<relativePath>../com.myrcpapp.parentplugin.path/pom.xml</relativePath>
<groupId>my.group.id</groupId>
<artifactId>parent</artifactId>
<version>1.0.0.qualifier</version>
</parent>
<groupId>my.group.id</groupId>
<artifactId>com.myrcpapp.dbplugin</artifactId>
<packaging>eclipse-plugin</packaging>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.2.0.CR1</version>
</dependency>
</dependencies>
</project>
当我运行eclipse:eclipse
目标时,一切都很好(类路径已很好地更新,并且在我的插件项目中很好地引用了 jar)并且我可以启动我的应用程序。但是当我尝试使用clean install
目标使用 Maven 构建我的应用程序时,构建失败。Maven 似乎可以解决“休眠”依赖。无论如何,我都会收到此错误:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.16.0:compile (default-compile) on project com.myrcpapp.dbplugin: Compilation failure: Compilation failure: com\myrcpapp\dbplugin
[ERROR] C:\Documents and Settings\user\workspace\com.myrcpapp.dbplugin\src\com\myrcpapp\dbplugin\service\impl\ClientService.java:[3,0]
[ERROR] import org.hibernate.Session;
[ERROR] ^^^^^^^^^^^^^
[ERROR] The import org.hibernate cannot be resolved
[ERROR] C:\Documents and Settings\user\workspace\com.myrcpapp.dbplugin\src\com\myrcpapp\dbplugin\service\impl\ClientService.java:[4,0]
[ERROR] import org.hibernate.Transaction;
[ERROR] ^^^^^^^^^^^^^
[..]
[ERROR] Table cannot be resolved to a type
[ERROR] C:\Documents and Settings\user\workspace\com.myrcpapp.dbplugin\src\com\myrcpapp\dbplugin\model\Client.java:[7,0]
[ERROR] @Table(name="clients")
[ERROR] ^^^^
[ERROR] The attribute name is undefined for the annotation type Table
[ERROR] 18 problems (18 errors)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :com.myrcpapp.dbplugin
关于我做错了什么的任何想法?
提前致谢