I have checked out a maven project into eclipse using subclipse.
I try to use the spring framework in my project, and have defined it as a required dependency:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
I have added the maven repo by adding the M2_REPO to my CLASS_PATH. I did that by executing this command on the cmd prompt:
mvn -Declipse.workspace="your Eclipse Workspace" eclipse:configure-workspace
I verified in Eclipse preferences that the M2_REPO variable is in my Classpath variable, and that the path refers to the repository directory of Maven.
However, a import statement like this:
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
does not work.
What can be the problem here?
EDIT:
Since this was a module under the root, i figured that i did not need to define the dependency on Spring once more in this module. However, including (copy paste the list from the root :s) solved the issue. But this can't be right since the POM.xml in the root already requieres that this module is included.