[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [m2e-users] Does eclipse "understand" the POM?
|
Well, it goes like this:
Eclipse Basics - When you create a project in Eclipse, two files are created by Eclipse in the project's subdirectory: .project and .classpath. These files are used by Eclipse to "understand" your project: it's type (e.g. Java), the classpath entries, etc.
M2E is a plugin for Eclipse.
When you first open a Maven project in Eclipse (File->Import->Existing Maven Project), M2E generates those files Eclipse works with (.project, and .classpath), and fill them with the info tapped in the pom.xml: Dependencies are translated into classpath entries, source directories (src/main/java, src/main/resources) are translated into source directories as Eclipse understands them.
Thus each time you update your pom, M2E wakes up and updates the .project and .classpath accordingly. Thus, if you are missing a Class, it means you need to add <dependency> in your pom.xml. Of course you need to make sure the dependencies you need for compilation does not have <scope> which is "test".
On ××× ×©××©× 19 ×××××¡× 2011 at 16:42, Ruttenberg, Tanya Contractor wrote:
I am new to maven, but not particularly new to eclipse.
When I get errors such as â<ClassName> cannot be resolved to a typeâ is the solution to add a project or library to the projectâs Build Path or to add a dependancy to the POM?
Iâm unclear on how much eclipse âunderstandsâ what is in the POM.
Can someone elaborate on this?
TDR