更改 pom.xml 不会更新 Eclipse 中的库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16399221/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Changing pom.xml doesn't update libraries in Eclipse
提问by Trick
I have pom.xml like this:
我有这样的 pom.xml:
...
<properties>
<spring.version>3.0.5.RELEASE</spring.version>
</properties>
<dependencies>
<!-- Spring 3 dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
...
When I change spring.version
into 3.2.2.RELEASE, nothing happens. I still have 3.0.5.RELEASE under Libraries build path.
当我更改spring.version
为 3.2.2.RELEASE 时,什么也没有发生。我在库构建路径下仍然有 3.0.5.RELEASE。
I am using Eclipse Indigo SR2 with m2eclipse.
我正在使用带有 m2eclipse 的 Eclipse Indigo SR2。
EDIT: Please mind, I am a newbie in maven world.
编辑:请注意,我是 Maven 世界的新手。
回答by khmarbaise
You need to update the project configuration manually. Project -> Maven -> Update Configuration
您需要手动更新项目配置。项目 -> Maven -> 更新配置
Update: Also set checkbox: Update Project Configuration from pom
更新:同时设置复选框:从 pom 更新项目配置
回答by mohsen.nour
Right-click on any project in the package explorer then select Maven. In maven select Update Project. or simply Alt + F5
右键单击包资源管理器中的任何项目,然后选择 Maven。在 maven 中选择更新项目。或者只是 Alt + F5