You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Miks Rozenbergs <Mi...@exigengroup.lv> on 2005/09/19 15:07:01 UTC

Dependancy on other source project without use

Hello!
Let's say I have 3 directories, each containing a Java project that I'm 
developing in Eclipse:
[my.app.runtime]
[my.app.ui]
[my.app.utils]
"my.app.utils" is used (imported) in both "my.app.runtime" and 
"my.app.ui". I somehow was under impression that it will be possible to 
tell that "my.app.runtime" depends on "my.app.utils" and that "my.app.ui" 
depends on "my.app.utils" and the rest will be handled by Maven -- e.g. 
when I'm running "m2 compile"  in [my.app.runtime], Maven will first 
copile "my.app.utils", then will add it to "my.app.runtime" class path and 
will compile "my.app.runtime".
Unfortunately I could not find how to do that. I know about modules, but 
that's IMHO adds a lot of extra work -- creating another pom.xml, adding 
<parent> tag to pom.xml's in my.app.runtime, my.app.ui and my.app.utils.
Comments? Suggestions?
Best Regards.
Miks Rozenbergs

Re: Dependancy on other source project without use

Posted by Kristian Nordal <kr...@gmail.com>.
On Sep 19, 2005, at 10:23 PM, Miks Rozenbergs wrote:



> Kristian Nordal <kristian.nordal <at> gmail.com> writes:
>
>
>
>
>> You need some way of connecting them together. If you don't have a
>> parent project, then they are just three independent projects. Then
>> you must put the dependencies in the repository manually. You should
>> look into creating a parent POM, <modules> are easy to use (and not a
>> lot of work) and things like dependency management is very nice.
>>
>>
>>
>>
>
> Exactly -- connect them together. And IMHO defining dependancy from
> "my.app.runtime" to "my.app.utils" is getting pretty close to  
> connecting two
> individuals together.
>
>

But where should it look for the other projects? Maven doesn't know  
that you have that project in another directory, next to the other  
project. If these artifacts are not in the same project, then the  
only "connection" is through the repository. So the dependency needs  
to be built in advance and put into the repository. Maybe it's  
possible to trigger a build in some way (this would then be from the  
repository or something like that, when a request is done), but I  
haven't heard of it.



> So, creation of a parent project is duplication of
> information.
>
>

I'm not sure of the inner workings of "modules", but I would guess  
that it looks for these modules/projects in the sub-directories, not  
in the repository. So this is another kind of "connection". This is  
not duplication of information, you are specifying where the project  
is located, not the built artifact.



> And what if "my.app.utils" depends on something else? Then someone
> should manually traverse all the dependancies and come up with a  
> complete list
> of modules to include in parent project.
>
>

I think you are mixing modules and dependencies. A dependency is  
fetched from the repository but modules are for defining recursive  
behavior in maven and relate projects (My understanding of it). Using  
modules, also implies (I think) defining the parent in the children  
POMs. This will enable Maven to generate a graph of this multi- 
project, so it's possible to trigger builds on dependencies in the  
project (since maven sees that they are connected / in the same multi- 
project, and know where to find the project).

These are just my impressions of how things work, so some of it (or  
all of it) might be wrong =)

--
Regards,
Kristian



> Regards,
> Miks
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Dependancy on other source project without use

Posted by Miks Rozenbergs <mi...@exigengroup.lv>.
Kristian Nordal <kristian.nordal <at> gmail.com> writes:

> You need some way of connecting them together. If you don't have a  
> parent project, then they are just three independent projects. Then  
> you must put the dependencies in the repository manually. You should  
> look into creating a parent POM, <modules> are easy to use (and not a  
> lot of work) and things like dependency management is very nice.
> 

Exactly -- connect them together. And IMHO defining dependancy from
"my.app.runtime" to "my.app.utils" is getting pretty close to connecting two
individuals together. So, creation of a parent project is duplication of
information. And what if "my.app.utils" depends on something else? Then someone
should manually traverse all the dependancies and come up with a complete list
of modules to include in parent project.

Regards,
Miks



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Dependancy on other source project without use

Posted by Kristian Nordal <kr...@gmail.com>.
On Sep 19, 2005, at 3:07 PM, Miks Rozenbergs wrote:

> Hello!
> Let's say I have 3 directories, each containing a Java project that  
> I'm
> developing in Eclipse:
> [my.app.runtime]
> [my.app.ui]
> [my.app.utils]
> "my.app.utils" is used (imported) in both "my.app.runtime" and
> "my.app.ui". I somehow was under impression that it will be  
> possible to
> tell that "my.app.runtime" depends on "my.app.utils" and that  
> "my.app.ui"
> depends on "my.app.utils" and the rest will be handled by Maven --  
> e.g.
> when I'm running "m2 compile"  in [my.app.runtime], Maven will first
> copile "my.app.utils", then will add it to "my.app.runtime" class  
> path and
> will compile "my.app.runtime".
> Unfortunately I could not find how to do that. I know about  
> modules, but
> that's IMHO adds a lot of extra work -- creating another pom.xml,  
> adding
> <parent> tag to pom.xml's in my.app.runtime, my.app.ui and  
> my.app.utils.
> Comments? Suggestions?

Hi,

You need some way of connecting them together. If you don't have a  
parent project, then they are just three independent projects. Then  
you must put the dependencies in the repository manually. You should  
look into creating a parent POM, <modules> are easy to use (and not a  
lot of work) and things like dependency management is very nice.

--
Regards,
Kristian

> Best Regards.
> Miks Rozenbergs


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org