Hi,

just to be sure I understood your problem correctly:
In some class of project C you import a package/class that is defined in project D. And then, when you try to build project C the Java compiler fails with an error that it can't find the imported package/class. Correct?

As Anshuman said you just need to declare a dependency to project D in your pom 
of project C.

From which directory do you execute your 'mvn ...'? command from project C or from the top level project (project A)?

In a multiproject build you always must run your mvn commands (with the possible exception of 'mvn clean') form the directory of the topmost project. Else maven can not calculate the all subprojects it has to build and therefore doesn't know anything about project D if you just try to build project C directly as a standalone project.

Hope this helps
-Tim

Sharma, Jaikumar schrieb:
I have folder structure of the project :
|------Project A | |-----sub-project B
|      |
|      |----|-------sub-sub project C
| | |-----------pom.xml | |----|------sub-sub project D
|      |    |-----------pom.xml
| |-----pom.xml |------pom.xml In this scanario, packages access is defined in the classes, when I compile
sub-sub project C, it says package does not exist (which is already there
sub-sub project D)
How to define dependency for this ? Thanks! Regards, Jaikumar
BM__MailAutoSig_________________________________________

Jaikumar Sharma

Sr.Software Development Engineer

Barco Control Rooms

A-5, Sector - 5,

Noida. India 201 301.

Tel +91 120-2421-651 to 659  Ext.313

Fax+91 120 2421 691

 <http://www.barco.com/> http://www.barco.com

 <mailto:[EMAIL PROTECTED]> mailto:[EMAIL PROTECTED]

_________________________________________

- - - - - - - DISCLAIMER- - - - - - - -
Unless indicated otherwise, the information contained in this message is
privileged and confidential, and is intended only for the use of the
addressee(s) named above and others who have been specifically authorized to
receive it. If you are not the intended recipient, you are hereby notified
that any dissemination, distribution or copying of this message and/or
attachments is strictly prohibited. The company accepts no liability for any
damage caused by any virus transmitted by this email. Furthermore, the
company does not warrant a proper and complete transmission of this
information, nor does it accept liability for any delays. If you have
received this message in error, please contact the sender and delete the
message. Thank you.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to