Here is my POM.xml file:
1.6
3.2.2.RELEAS
Add these dependencies
</dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.3.7.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.7.RELEASE</version>
</dependency>
</dependencies>
You need to follow a few steps to debug properly.
1) mvn clean dependency:tree
Take a look at the output to see exactly what you get and verify your dependencies are all there.
2) mvn clean compile
. Does this fail? If not does that mean you only get the error in Eclipse?
You mentioned in a comment "And I run both commands above but I am getting this error". Did mvn clean compile
work? Or did you get an error for that as well? If it worked then it's just an IDE problem and I'd look at the m2eclipse
plugin. Better still, use IntelliJ as the free version has better maven support than Eclipse ;-)
Some style things ...
People often add too many dependencies in their pom file when they don't need to. If you take a look at a couple of links in mavenrepository.com you can see that spring-oxm
and spring-jdbc
both depend on spring-core
so you don't need to add that explicitly (for example). mvn clean dependency:tree
will show you what is coming in after all of that, but this is more tidying.
spring-batch-test
should be test
scope.
The solution that worked for me was to right click on the project --> Maven --> Update Project then click OK.
There are few steps you can follow
remove repository folder
C:/Users/user_name/.m2
Then run command using IDE terminal or open cmd in your project folder
mvn clean install
Restart your ide
If not solve your problem then run this command
mvn idea:idea
org.springframework.beans.factory.support.beannamegenerator , was my error. I did a maven clean, maven build etc., which was not useful and I found that my .m2 folder is not present in my eclipse installation folder. I found the .m2 folder out side of the eclipse folder which I pasted in the eclipse folder and then in eclipse I happened to do this :-
Open configure build path maven Java EE integration Select Maven archiver generates files under the build directory apply and close
My project is up and running now.