Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing pom.xml doesn't update libraries in Eclipse

I have pom.xml like this:

...

<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.

I am using Eclipse Indigo SR2 with m2eclipse.

EDIT: Please mind, I am a newbie in maven world.

like image 485
Trick Avatar asked May 06 '13 12:05

Trick


People also ask

Does this preference apply to the pom editor or the XML editor?

That preference applies to the XML Editor, and XML editors based on it. It wouldn't apply to the revamped source page in the POM Editor. Sorry, something went wrong. @nitind That's fair enough. I must admit I didn't really follow the reasons for revamping/changing the POM XML editor (I'm sure there are good ones).

How do I update a Maven project in Eclipse?

Right-click on any project in the package explorer then select Maven. In maven select Update Project. or simply Alt + F5 Thanks for contributing an answer to Stack Overflow!

Does maven4myeclipse automatically update dependencies when a pom changes?

Before when we made a change to a pom, or if a pom changed through an update from our code repository, MyEclipse and Maven4MyEclipse seemed to detect this and automatically it would update the dependencies for the project, so the dependency changes would immediately show up in the maven classpath.

What is settings XML in Maven?

A Maven settings.xml file defines values that configure Maven execution in many ways. Mainly it is used to configure a local repository location, alternate remote repository servers, Profiles Settings, and authentication information for private repositories. Furthermore, is settings XML mandatory for Maven?


2 Answers

You need to update the project configuration manually. Project -> Maven -> Update Configuration

Update: Also set checkbox: Update Project Configuration from pom

like image 87
khmarbaise Avatar answered Sep 22 '22 06:09

khmarbaise


Right-click on any project in the package explorer then select Maven. In maven select Update Project. or simply Alt + F5

like image 26
mohsen.nour Avatar answered Sep 23 '22 06:09

mohsen.nour