Maven Spring Hibernate 项目中的 Jars 问题
I had made Web Application on Spring and Hibernate by taking reference from Vaannila
When I specify lib name on pom.xml using eclipse, the maven repository could not include all the jars.
How can I include the jars on my application?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你可以使用maven install:install 命令它将 jar 包含到您的 Maven 存储库中
mvn install:install-file -DgroupId=group_id -DartifactId=artifact_id -Dversion=version -Dpackaging=jar -Dfile=path_to_jar
为此,你可以尝试 mvn package - maven 会给出一个错误,要求使用上面的命令 - 复制粘贴它,更改路径并在命令提示符中使用它。
或
将 jar 添加为外部 jar - 在 Eclipse 中右键单击您的项目 - 转到属性 --> 构建路径 --> 库 --> 添加外部 jar
要从中央存储库下载,请将以下内容添加到您的 pom
Hibernate 和 Hibernate 注释是单独的 jar。这些是我使用的依赖项。尝试一下。
要手动执行此操作,
请从 此处并将其保存在 C:/temp 或任何您想要的位置。然后执行
mvn install:install-file -DgroupId=org.hibernate -DartifactId=hibernate-annotations -Dversion=3.4.0.GA -Dpackaging=jar -Dfile=C:/temp/hibernate-annotations-3.4.0.GA。罐
you could use the maven install:install command which includes the jars into your maven repo
mvn install:install-file -DgroupId=group_id -DartifactId=artifact_id -Dversion=version -Dpackaging=jar -Dfile=path_to_jar
For this , you could try mvn package - maven will given an error asking use to use the above command - copy paste it , change the path and use it in your command prompt .
or
add the jar as an external jar - Right click your project in Eclipse - go to properties -->Build path -->Libraries -->Add external jars
To download from the central repo ,add the following to your pom
Hibernate and Hibernate annotations are separate jars . These are the dependencies I use . Try them .
To do this manually ,
Download hibernate-annotations from here and save it in C:/temp or wherever you want. Then perform
mvn install:install-file -DgroupId=org.hibernate -DartifactId=hibernate-annotations -Dversion=3.4.0.GA -Dpackaging=jar -Dfile=C:/temp/hibernate-annotations-3.4.0.GA.jar
请参阅此 Maven Spring Hibernate 示例项目。
希望您能从那里轻松理解。
See this Maven Spring Hibernate example project.
Hopefully you will easily understand from there.