简体   繁体   English

Maven和pom.xml

[英]Maven and pom.xml

I'm using m2eclipse and trying to learn some tapestry. 我正在使用m2eclipse并尝试学习一些挂毯。 I'm trying to update my project to pull some different resources from maven. 我正在尝试更新我的项目以从maven中提取一些不同的资源。 (Or at least, I think that's what I'm trying to do). (或者至少,我认为这就是我想要做的)。

Here's part of my pom.xml: 这是我的pom.xml的一部分:

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

The artifact id used to be tapestry-core, but the tutorial I'm using said to change it to tapestry-hibernate so I can use hibernate. 工件id曾经是tapestry-core,但我正在使用的教程说它将它改为tapestry-hibernate所以我可以使用hibernate。 I changed the pom.xml and saved it, but I'm not sure what command exactly I'm supposed to execute exactly. 我更改了pom.xml并保存了它,但我不确定究竟应该执行什么命令。 I tried using some of the plugin commands like "update dependencies", but I still don't have a hibernate.cfg.xml file generated, which I think I should have, right? 我尝试使用一些插件命令,如“更新依赖项”,但我仍然没有生成hibernate.cfg.xml文件,我认为我应该拥有,对吧?

I changed the pom.xml and saved it, but I'm not sure what command exactly I'm supposed to execute exactly. 我更改了pom.xml并保存了它,但我不确定究竟应该执行什么命令。

m2eclipse should setup the new dependencies (and download it if necessary) after you changed the pom.xml without any required action. 在没有任何必要操作的情况下更改pom.xml之后,m2eclipse应该设置新的依赖项(并在必要时下载它)。

I tried using some of the plugin commands like "update dependencies", but I still don't have a hibernate.cfg.xml file generated, which I think I should have, right? 我尝试使用一些插件命令,如“更新依赖项”,但我仍然没有生成hibernate.cfg.xml文件,我认为我应该拥有,对吧?

No, the hibernate.cfg.xml won't get automagically generated just because you changed a dependency (it is possible to generate an hibernate.cfg.xml with the hibernate3-maven-plugin but I don't think you are using it and it's really not easy to use). 不, hibernate.cfg.xml不会因为你改变了一个依赖项而自动生成(可以使用hibernate3-maven-plugin生成一个hibernate.cfg.xml ,但我不认为你正在使用它它真的不容易使用)。

You need both dependencies: tapestry-core and tapestry-hibernate. 你需要两个依赖:tapestry-core和tapestry-hibernate。 On the other hand, tapestry-hibernate depencds on tapestry-core, so the latter is included automatically by Maven. 另一方面,tapestry-hibernate依赖于tapestry-core,因此后者由Maven自动包含。 tapestry-hibernate doesn't create a hibernate.cfg.xml for you. tapestry-hibernate不会为你创建一个hibernate.cfg.xml。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 存档pom.xml Maven Hibernate - Archive pom.xml Maven Hibernate 为什么 Intellij 在 pom.xml 中找不到任何 Maven 依赖项? - Why Intellij do not find any Maven dependencies in pom.xml? POM.xml(MAVEN):在参考库中找不到JAR依赖项 - POM.xml (MAVEN): JAR dependencies Not Found in Referenced Libraries 在wildfly 10上部署Maven Web应用程序:pom.xml问题 - deploy maven webapp on wildfly 10: issue with pom.xml 将Hibernate 3.5.x添加到maven pom.xml构建中 - Adding Hibernate 3.5.x to a maven pom.xml build 我正在使用 hibernate,没有 pom.xml 或 maven 并得到错误? - I am using hibernate, no pom.xml or maven and getting the error? 使用pom.xml下载软件包时,Maven构建错误 - Maven build error when downloading packages using pom.xml JavaFX Maven 将 sqljdbc 依赖项添加到 pom.xml (netbeans 8.2 jdk8) 时项目错误 - JavaFX Maven project error when adding sqljdbc dependency to pom.xml (netbeans 8.2 jdk8) 如何通过Maven2 pom.xml获取Hibernate + javax.persistence - How to get Hibernate + javax.persistence via Maven2 pom.xml java.lang.NoClassDefFoundError:Eclipse中的Maven pom.xml上带有TransactionInterceptor错误的org / aopalliance / intercept / MethodInterceptor - java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor with TransactionInterceptor error on maven pom.xml in eclipse
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM