xDoclet、Maven 和 Hibernate
我在设置 xDocklet 时遇到一些问题并收到此错误。
从存储库解析插件“xdoclet:maven2-xdoclet2-plugin”版本时出错
<pluginRepositories>
<pluginRepository>
<id>codehaus-plugins</id>
<url>http://dist.codehaus.org/</url>
<layout>legacy</layout>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<plugin>
<groupId>xdoclet</groupId>
<artifactId>maven2-xdoclet2-plugin</artifactId>
<executions>
<execution>
<id>xdoclet</id>
<phase>generate-sources</phase>
<goals>
<goal>xdoclet</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>xdoclet-plugins</groupId>
<artifactId>xdoclet-plugin-qtags</artifactId>
<version>1.0.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>xdoclet-plugins</groupId>
<artifactId>xdoclet-taglib-qtags</artifactId>
<version>1.0.4-SNAPSHOT</version>
</dependency>
</dependencies>
<goals>
<goal>xdoclet</goal>
</goals>
<configuration>
<configs>
<config>
<components>
<component> <classname>org.xdoclet.plugin.qtags.impl.QTagImplPlugin</classname>
</component>
<component>
<classname>org.xdoclet.plugin.qtags.impl.QTagLibraryPlugin</classname>
<params> <packagereplace>org.xdoclet.plugin.${xdoclet.plugin.namespace}.qtags</packagereplace>
</params>
</component>
<component>
<classname>org.xdoclet.plugin.qtags.doclipse.QTagDoclipsePlugin</classname>
<params>
<filereplace>qtags.xml</filereplace>
<namespace>${xdoclet.plugin.namespace}</namespace>
</params>
</component>
<component>
<classname>org.xdoclet.plugin.qtags.confluence.QTagConfluencePlugin</classname>
<params>
<destdir>${project.build.directory}/tag-doc</destdir>
<namespace>${xdoclet.plugin.namespace}</namespace> <filereplace>${xdoclet.plugin.namespace}.confluence</filereplace>
</params>
</component>
</components>
<includes>**/*.java</includes>
<params>
<destdir>${project.build.directory}/generated-resources/xdoclet</destdir>
</params>
</config>
</configs>
</configuration>
</plugin>
我的一些问题。
- 你会推荐我去吗 与 xDocklet。有没有 替代品吗?
- 这是最好的方法之一吗,就像 hbm 的那样 确实会自动生成。
- 关于我的方式的任何建议 Java 对象应该被持久化 数据库?
- 关于 xDocklet 的任何好的教程 Maven 和休眠。
我正在使用 xDocklet 通过注释 POJO 自动生成 HBM。
I am having some trouble setting up xDocklet and getting this error.
Error resolving version for plugin 'xdoclet:maven2-xdoclet2-plugin' from the repositories
<pluginRepositories>
<pluginRepository>
<id>codehaus-plugins</id>
<url>http://dist.codehaus.org/</url>
<layout>legacy</layout>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<plugin>
<groupId>xdoclet</groupId>
<artifactId>maven2-xdoclet2-plugin</artifactId>
<executions>
<execution>
<id>xdoclet</id>
<phase>generate-sources</phase>
<goals>
<goal>xdoclet</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>xdoclet-plugins</groupId>
<artifactId>xdoclet-plugin-qtags</artifactId>
<version>1.0.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>xdoclet-plugins</groupId>
<artifactId>xdoclet-taglib-qtags</artifactId>
<version>1.0.4-SNAPSHOT</version>
</dependency>
</dependencies>
<goals>
<goal>xdoclet</goal>
</goals>
<configuration>
<configs>
<config>
<components>
<component> <classname>org.xdoclet.plugin.qtags.impl.QTagImplPlugin</classname>
</component>
<component>
<classname>org.xdoclet.plugin.qtags.impl.QTagLibraryPlugin</classname>
<params> <packagereplace>org.xdoclet.plugin.${xdoclet.plugin.namespace}.qtags</packagereplace>
</params>
</component>
<component>
<classname>org.xdoclet.plugin.qtags.doclipse.QTagDoclipsePlugin</classname>
<params>
<filereplace>qtags.xml</filereplace>
<namespace>${xdoclet.plugin.namespace}</namespace>
</params>
</component>
<component>
<classname>org.xdoclet.plugin.qtags.confluence.QTagConfluencePlugin</classname>
<params>
<destdir>${project.build.directory}/tag-doc</destdir>
<namespace>${xdoclet.plugin.namespace}</namespace> <filereplace>${xdoclet.plugin.namespace}.confluence</filereplace>
</params>
</component>
</components>
<includes>**/*.java</includes>
<params>
<destdir>${project.build.directory}/generated-resources/xdoclet</destdir>
</params>
</config>
</configs>
</configuration>
</plugin>
Some of my questions.
- Would you recommend me with going
with xDocklet. Is there any
alternative for it? - Is it one of the best way, as hbm's
does get generated automatically. - Any suggestions on the way how my
Java Objects should get persisted in
the DB? - Any good tutorials over xDocklet
Maven and Hibernate.
I am using xDocklet to generate HBM's automatically by annotating my POJO's.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您正在注释 POJO,那么您绝对应该使用 Hibernate Annotations(或更好的:JPA)。当 Java 中无法使用注释时,xDoclet 是一个很好的解决方案。
If you are annotating your POJO's, you should definitely use Hibernate Annotations (or better: JPA). xDoclet was a good solution when Annotations were not available in Java.