Spring、Maven 依赖关系和 Jar 问题
我参考了 Spring MVC 和 Hibernate 应用程序 这里
在办公系统上(运行Ubuntu) 。它运行良好并且没有显示任何问题。
当我在我的家庭系统(运行 Windows XP)上复制并保存应用程序时,错误显示某些 jar 无法传输。
另外,这种依赖
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.2.GA</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
在我的 xp 系统上不起作用。
当我将 hibernate 版本更改为 3.6.x 时,jar 已成功传输。
我在两个系统上运行 Maven 3 和 m2eclipse。
敬请指教..
I had made Spring MVC and Hibernate application by taking reference from
here
on the office system(running Ubuntu). It's running fine and showing no problems.
When I copy and save the application on my home system (running windows xp), error shown that some jars failed to transfer.
Also, this dependecy
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.2.GA</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
doesn't work on my xp system.
When I changes the hibernate version to 3.6.x, jars successfully transferred.
I am running maven 3 and m2eclipse on both systems.
Kindly Advice..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以执行 mvn install:install 将 jar 手动安装到.m2 目录。当您尝试打包应用程序时,您将看到构建失败,并建议您执行 mvn install:install 。从 此处手动下载 jar< /a> ,执行 mvn install:install ,然后执行 mvn eclipse:eclipse 并刷新工作区。
You could do mvn install:install to install the jar manually into the .m2 directory . When you try to package the app , you'll see a build failure with a recommendation that you do an mvn install:install . Download the the jar manually from here , do a mvn install:install followed by mvn eclipse:eclipse and refresh the workspace .
您的 Ubuntu 系统
$HOME/.m2/repository
上的本地存储库中似乎有一些文件在 XP 计算机c:\Documents and Settings\$USER\ 上不存在.m2\存储库
。您可以从 Linux 存储库复制文件,也可以使用
mvn install:install-file
手动更新 Windows 存储库。希望有帮助
It seems you have some files in your local repository on your Ubuntu system
$HOME/.m2/repository
that don't exist on your XP machinec:\Documents and Settings\$USER\.m2\repository
.You can either copy the files from the linux repo or use
mvn install:install-file
to update your windows repo manually.hope that helped
有时windows下的本地maven仓库(我只用windows,不能代表其他系统)很奇怪。这意味着它不会更新以前未发现的人工制品。
在这种情况下,您的本地
.m2
目录中有该工件的子直接目录,但它几乎是空的(除了 2 个文件)。如果发生这种情况,我会删除该目录,然后再次调用 maven(例如mvncompile
)。Sometimes the local maven repository under windows (I only use windows, I can not speak for the other systems) strange. This means it does not uodate former not found artefact.
In this cases you have the subdirect directory for the artefact in you local
.m2
directory but it is almost empty (except 2 files). If this happen I delete that directory and then invoke maven (for examplemvn compile
) again.您可以通过将 Spring 存储库添加到您的 pom 文件来尝试此操作吗?
Can you try this by adding the Spring repository to your pom file.