【问题标题】:Maven and pom.xmlMaven 和 pom.xml
【发布时间】:2011-05-10 13:20:32
【问题描述】:

我正在使用 m2eclipse 并尝试学习一些挂毯。我正在尝试更新我的项目以从 Maven 中提取一些不同的资源。 (或者至少,我认为这就是我想要做的)。

这是我的 pom.xml 的一部分:

<dependency>
            <groupId>org.apache.tapestry</groupId>
            <artifactId>tapestry-hibernate</artifactId>
            <version>${tapestry-release-version}</version>
        </dependency>

工件 id 曾经是 Tapestry-core,但我使用的教程说将其更改为 Tapestry-hibernate,以便我可以使用休眠。我更改了 pom.xml 并保存了它,但我不确定我应该准确执行什么命令。我尝试使用一些插件命令,如“更新依赖项”,但我仍然没有生成 hibernate.cfg.xml 文件,我认为我应该有,对吧?

【问题讨论】:

  • 我最终只是自己创建了 hibernate.cfg.xml。教程没有指定它会自动出现,也没有说我必须自己创建,所以也许这是对的。

标签: hibernate maven-2 maven m2eclipse tapestry


【解决方案1】:

我更改了 pom.xml 并保存了它,但我不确定我应该准确执行什么命令。

在您更改 pom.xml 后,m2eclipse 应该设置新的依赖项(必要时下载)。

我尝试使用一些插件命令,例如“更新依赖项”,但我仍然没有生成 hibernate.cfg.xml 文件,我认为我应该有,对吧?

不,hibernate.cfg.xml 不会因为您更改了依赖项而自动生成(可以使用hibernate3-maven-plugin 生成hibernate.cfg.xml,但我认为您没有使用它,实际上不是易于使用)。

【讨论】:

  • 谢谢,我已经自己创建了文件
【解决方案2】:

您需要两个依赖项:tapestry-core 和 Tapestry-hibernate。另一方面,tapestry-hibernate 依赖于tapestry-core,因此后者被Maven 自动包含。 Tapestry-hibernate 不会为您创建 hibernate.cfg.xml。

【讨论】:

    猜你喜欢
    • 2012-03-20
    • 2011-03-03
    • 2022-01-17
    • 2017-06-26
    • 1970-01-01
    • 1970-01-01
    • 2012-10-05
    • 2017-07-19
    • 2019-05-21
    相关资源
    最近更新 更多