facebook

Maven Dependencies renders a different version

  1. MyEclipse IDE
  2.  > 
  3. Maven for MyEclipse (Maven4MyEclipse)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #350692 Reply

    Lockheed Martin
    Participant

    I come across a very weird problem. In my pom.xml I have a dependency as:

    <dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-lang3</artifactId>
    <version>RELEASE</version>
    <scope>compile</scope>
    </dependency>

    When I run Maven (either with a command line or inside MyEclipse), the resolved version is 3.3.2. This is the correct version. However, in the IDE, the “Maven Dependencies” in Java Build Path->Libraries, it renders an order version (3.2.1). This means if I deploy the application inside IDE, it would use a different version of the JAR file. To fix the problem, I have to hard-code <version>3.3.2</version>, which is not desirable because I want to stay on the latest release version, and not to hard-code a specific version.

    How does the “Maven Dependencies” JAR/class paths are rendered?

    #350702 Reply

    support-swapna
    Moderator

    Hi,

    Sorry that you are seeing this issue. I could not replicate the issue at my end.

    1. Can you please share the MyEclipse Installation Details from Help > About ?
    2. Remove the dependency and update dependencies on the project (right click on project > Maven4MyEclipse > Update Dependencies). Add the dependency and again update dependencies on the project and see how it works.
    3. Can you also check if you see the same issue on a new Maven project?

    Here is the screenshot :

    Let us know how it works for you.

    #350708 Reply

    Lockheed Martin
    Participant

    I finally fixed the problem by removing the information in my local .m2 repository. Still, I don’t understand why Maven command worked if the local repository was the problem.

    Anyway, thank you for looking into this.

    #350736 Reply

    support-swapna
    Moderator

    Hi,

    Glad that you got it working.

    Maven build command always checks for the latest version in the remote repo. In this case, probably it took the existing version in the local repo. I tried to replicate the issue by adding the older version of the dependency to the local repo and then set the version to ‘RELEASE’. It fetches the latest version and I see no issues at my end. I have filed it for further investigation.

    Let us know if you see any issues.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Maven Dependencies renders a different version

You must be logged in to post in the forum log in