- This topic has 3 replies, 2 voices, and was last updated 10 years, 3 months ago by support-swapna.
-
AuthorPosts
-
Lockheed MartinParticipantI 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?
support-swapnaModeratorHi,
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.
Lockheed MartinParticipantI 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.
support-swapnaModeratorHi,
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.
-
AuthorPosts