Thank you for that great explanation.  Your last two paragraphs answer my 
question exactly.  The short answer is basically "yes".  And when you need to 
adjust dependancies, you do it in the pom.xml and you really should not have to 
update the eclipse "Build Path..." manually at all.

TDR

------------------------------

Message: 3
Date: Sat, 20 Aug 2011 15:11:34 +0300
From: Asaf Mesika <[email protected]>
To: Maven Integration for Eclipse users mailing list
        <[email protected]>
Subject: Re: [m2e-users] Does eclipse "understand" the POM?
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

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".  

--  
Asaf Mesika
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

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
>  
>  
>  
> _______________________________________________
> m2e-users mailing list
> [email protected] (mailto:[email protected])
> https://dev.eclipse.org/mailman/listinfo/m2e-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<https://dev.eclipse.org/mailman/private/m2e-users/attachments/20110820/9e97557c/attachment.htm>

------------------------------

_______________________________________________
m2e-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/m2e-users


End of m2e-users Digest, Vol 31, Issue 50
*****************************************
_______________________________________________
m2e-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/m2e-users

Reply via email to