You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Danni <dk...@tvrl.net> on 2007/10/23 16:41:47 UTC

Dependency understanding problem

Hi All,
I am new to maven. I want to use it to get some kind of versioning system
going for our multi-project application.
So far everything went smooth, but now i'm getting to the point where i want
to build jars for single projects which depend on other projects. My
question is:

how do i declare a dependency on another project instead of on a jar-file?

it seems to me maven is always looking for jars, which cant be built because
other jars are missing to compile and package them:

Compiler output:
Missing:
----------
1) net.tvrl.:burancore2:jar:0.1.1.1


with POM entry:

    <dependency>
      <groupId>net.tvrl</groupId>
      <artifactId>burancore2</artifactId>
      <version>0.1.1.1</version>
    </dependency>


Of Course the Compiler cant find that jar, because it hasnt been created
yet. To create it, the burancore is dependent on other jars, which
themselves don't exist.
frustrating.
Can anyone help?

Thx


-- 
View this message in context: http://www.nabble.com/Dependency-understanding-problem-tf4677961s177.html#a13365897
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Dependency understanding problem

Posted by Victor Cardona <v....@sbcglobal.net>.
Danni wrote:
> 
> Michael McCallum-3 wrote:
>> I think the ultimate goal is that any artifact should be able to be
>> checked 
>> out and built without the need to install anything...
>>
> 
> That's my goal exactly. I'm trying to figure out if I can get maven to build
> every module by automatically installing/updating all other modules it
> depends on.
> My question is: is it possible to compile and build single modules just by
> specifying dependencys on other modules/projects? Or do these other modules
> have to be jar-packaged first? 
> Because it seems to me that all dependencies have to be given in the form of
> jar's.
> 
> 
> Wayne Fay wrote:
>> If these are all part of the same larger project, then you should
>> probably have a parent pom with <modules> specified. Then when you
>> build from the top parent, Maven figures out the correct build graph
>> and things Just Work.
>>
> 
> I go that going, but the project is rather large and I'm trying to avoid
> having to build the whole project every time I change a single module.
>  
> thanx for your replies 
> 
> 
> Michael McCallum-3 wrote:
>> I think the ultimate goal is that any artifact should be able to be
>> checked 
>> out and built without the need to install anything...
>>
>> that provides the least cost entry point for a new developer to being able
>> to 
>> participate in a systems development...
>>
>> look at the way the xorg project has broken itself down... kde too... they
>> are 
>> moving in the oposite direction from monolithic build... you want to allow
>> a 
>> developer to pickup a small well defined piece of code and be able to fix 
>> it/change it test it and verify it without having to necessarily have a
>> full 
>> understanding of the system
>>
>> On Wednesday 24 October 2007 04:31, Wayne Fay wrote:
>>> You've got to start at the beginning. Go to the simplest jar that has
>>> the fewest dependencies, build it, and install it (mvn install).
>>>
>>> Then go to the next one (that probably has a dependency on the first
>>> one) and do the same. Rinse and repeat until all jars build and are
>>> installed.
>>>
>>> If these are all part of the same larger project, then you should
>>> probably have a parent pom with <modules> specified. Then when you
>>> build from the top parent, Maven figures out the correct build graph
>>> and things Just Work.
>>>
>>> Wayne
>>>
>>> On 10/23/07, Danni <dk...@tvrl.net> wrote:
>>>> Hi All,
>>>> I am new to maven. I want to use it to get some kind of versioning
>>> system
>>>> going for our multi-project application.
>>>> So far everything went smooth, but now i'm getting to the point where i
>>>> want to build jars for single projects which depend on other projects.
>>> My
>>>> question is:
>>>>
>>>> how do i declare a dependency on another project instead of on a
>>>> jar-file?
>>>>
>>>> it seems to me maven is always looking for jars, which cant be built
>>>> because other jars are missing to compile and package them:
>>>>
>>>> Compiler output:
>>>> Missing:
>>>> ----------
>>>> 1) net.tvrl.:burancore2:jar:0.1.1.1
>>>>
>>>>
>>>> with POM entry:
>>>>
>>>>     <dependency>
>>>>       <groupId>net.tvrl</groupId>
>>>>       <artifactId>burancore2</artifactId>
>>>>       <version>0.1.1.1</version>
>>>>     </dependency>
>>>>
>>>>
>>>> Of Course the Compiler cant find that jar, because it hasnt been
>>> created
>>>> yet. To create it, the burancore is dependent on other jars, which
>>>> themselves don't exist.
>>>> frustrating.
>>>> Can anyone help?
>>>>
>>>> Thx
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>>
>>> http://www.nabble.com/Dependency-understanding-problem-tf4677961s177.html
>>>> #a13365897 Sent from the Maven - Users mailing list archive at
>>> Nabble.com.
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>> -- 
>> Michael McCallum
>> Enterprise Engineer
>> mailto:gholam@apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
> 

If you want to depend on the other modules or projects, and they do not
have artifacts in a repository, then you need to add the projects as
modules under a parent project.  For instance, I have a Java EE project
that builds into an EAR file.  That EAR file depends on a JAR and a WAR
file.  I structured my project as follows:

Parent Project (POM)
  |
  |`-- EJBs (JAR)
  |
  |`-- Web App (WAR)
  |
   `-- Final build (EAR)

Common stuff is specified in the parent POM, and then artifact specific
stuff is specified in the child POMs.  The WAR depends on the JAR, and
the EAR depends on both.

You question to me sounds like you only want to check out the one
project you are working on, and have it depend on projects located
elsewhere that you do not have under your direct control.  This sounds
like something that will cause you trouble later on.  If you are going
to use Maven, then your best bets are to get you fellow developers to
install their artifacts into a repository (snapshots work well for
this), or to reorganize the project structure so that it is similar to
what I described above.

Victor


Re: Dependency understanding problem

Posted by Danni <dk...@tvrl.net>.

Michael McCallum-3 wrote:
> 
> I think the ultimate goal is that any artifact should be able to be
> checked 
> out and built without the need to install anything...
> 

That's my goal exactly. I'm trying to figure out if I can get maven to build
every module by automatically installing/updating all other modules it
depends on.
My question is: is it possible to compile and build single modules just by
specifying dependencys on other modules/projects? Or do these other modules
have to be jar-packaged first? 
Because it seems to me that all dependencies have to be given in the form of
jar's.


Wayne Fay wrote:
> 
> If these are all part of the same larger project, then you should
> probably have a parent pom with <modules> specified. Then when you
> build from the top parent, Maven figures out the correct build graph
> and things Just Work.
> 

I go that going, but the project is rather large and I'm trying to avoid
having to build the whole project every time I change a single module.
 
thanx for your replies 


Michael McCallum-3 wrote:
> 
> I think the ultimate goal is that any artifact should be able to be
> checked 
> out and built without the need to install anything...
> 
> that provides the least cost entry point for a new developer to being able
> to 
> participate in a systems development...
> 
> look at the way the xorg project has broken itself down... kde too... they
> are 
> moving in the oposite direction from monolithic build... you want to allow
> a 
> developer to pickup a small well defined piece of code and be able to fix 
> it/change it test it and verify it without having to necessarily have a
> full 
> understanding of the system
> 
> On Wednesday 24 October 2007 04:31, Wayne Fay wrote:
>> You've got to start at the beginning. Go to the simplest jar that has
>> the fewest dependencies, build it, and install it (mvn install).
>>
>> Then go to the next one (that probably has a dependency on the first
>> one) and do the same. Rinse and repeat until all jars build and are
>> installed.
>>
>> If these are all part of the same larger project, then you should
>> probably have a parent pom with <modules> specified. Then when you
>> build from the top parent, Maven figures out the correct build graph
>> and things Just Work.
>>
>> Wayne
>>
>> On 10/23/07, Danni <dk...@tvrl.net> wrote:
>> > Hi All,
>> > I am new to maven. I want to use it to get some kind of versioning
>> system
>> > going for our multi-project application.
>> > So far everything went smooth, but now i'm getting to the point where i
>> > want to build jars for single projects which depend on other projects.
>> My
>> > question is:
>> >
>> > how do i declare a dependency on another project instead of on a
>> > jar-file?
>> >
>> > it seems to me maven is always looking for jars, which cant be built
>> > because other jars are missing to compile and package them:
>> >
>> > Compiler output:
>> > Missing:
>> > ----------
>> > 1) net.tvrl.:burancore2:jar:0.1.1.1
>> >
>> >
>> > with POM entry:
>> >
>> >     <dependency>
>> >       <groupId>net.tvrl</groupId>
>> >       <artifactId>burancore2</artifactId>
>> >       <version>0.1.1.1</version>
>> >     </dependency>
>> >
>> >
>> > Of Course the Compiler cant find that jar, because it hasnt been
>> created
>> > yet. To create it, the burancore is dependent on other jars, which
>> > themselves don't exist.
>> > frustrating.
>> > Can anyone help?
>> >
>> > Thx
>> >
>> >
>> > --
>> > View this message in context:
>> >
>> http://www.nabble.com/Dependency-understanding-problem-tf4677961s177.html
>> >#a13365897 Sent from the Maven - Users mailing list archive at
>> Nabble.com.
>> >
>> >
>> > ---------------------------------------------------------------------
>> > 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
> 
> -- 
> Michael McCallum
> Enterprise Engineer
> mailto:gholam@apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Dependency-understanding-problem-tf4677961s177.html#a13380702
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Dependency understanding problem

Posted by Michael McCallum <gh...@apache.org>.
I think the ultimate goal is that any artifact should be able to be checked 
out and built without the need to install anything...

that provides the least cost entry point for a new developer to being able to 
participate in a systems development...

look at the way the xorg project has broken itself down... kde too... they are 
moving in the oposite direction from monolithic build... you want to allow a 
developer to pickup a small well defined piece of code and be able to fix 
it/change it test it and verify it without having to necessarily have a full 
understanding of the system

On Wednesday 24 October 2007 04:31, Wayne Fay wrote:
> You've got to start at the beginning. Go to the simplest jar that has
> the fewest dependencies, build it, and install it (mvn install).
>
> Then go to the next one (that probably has a dependency on the first
> one) and do the same. Rinse and repeat until all jars build and are
> installed.
>
> If these are all part of the same larger project, then you should
> probably have a parent pom with <modules> specified. Then when you
> build from the top parent, Maven figures out the correct build graph
> and things Just Work.
>
> Wayne
>
> On 10/23/07, Danni <dk...@tvrl.net> wrote:
> > Hi All,
> > I am new to maven. I want to use it to get some kind of versioning system
> > going for our multi-project application.
> > So far everything went smooth, but now i'm getting to the point where i
> > want to build jars for single projects which depend on other projects. My
> > question is:
> >
> > how do i declare a dependency on another project instead of on a
> > jar-file?
> >
> > it seems to me maven is always looking for jars, which cant be built
> > because other jars are missing to compile and package them:
> >
> > Compiler output:
> > Missing:
> > ----------
> > 1) net.tvrl.:burancore2:jar:0.1.1.1
> >
> >
> > with POM entry:
> >
> >     <dependency>
> >       <groupId>net.tvrl</groupId>
> >       <artifactId>burancore2</artifactId>
> >       <version>0.1.1.1</version>
> >     </dependency>
> >
> >
> > Of Course the Compiler cant find that jar, because it hasnt been created
> > yet. To create it, the burancore is dependent on other jars, which
> > themselves don't exist.
> > frustrating.
> > Can anyone help?
> >
> > Thx
> >
> >
> > --
> > View this message in context:
> > http://www.nabble.com/Dependency-understanding-problem-tf4677961s177.html
> >#a13365897 Sent from the Maven - Users mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > 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

-- 
Michael McCallum
Enterprise Engineer
mailto:gholam@apache.org

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


RE: Dependency understanding problem

Posted by EJ Ciramella <ej...@upromise.com>.
Another way to think of this is you really shouldn't have many "jar
only" modules, no?

If you're using something like CC, then each of these "jar only" modules
would be separate projects.  The final application (ear/war/w/e) will
depend on these other modules.  When it comes time to build the
ear/war/etc type modules, it will pull from your repository (if you have
set one up for internal use).  I think the goal is to NOT build every
module each and every time you need to build your application. 

-----Original Message-----
From: Wayne Fay [mailto:waynefay@gmail.com] 
Sent: Tuesday, October 23, 2007 11:32 AM
To: Maven Users List
Subject: Re: Dependency understanding problem

You've got to start at the beginning. Go to the simplest jar that has
the fewest dependencies, build it, and install it (mvn install).

Then go to the next one (that probably has a dependency on the first
one) and do the same. Rinse and repeat until all jars build and are
installed.

If these are all part of the same larger project, then you should
probably have a parent pom with <modules> specified. Then when you
build from the top parent, Maven figures out the correct build graph
and things Just Work.

Wayne

On 10/23/07, Danni <dk...@tvrl.net> wrote:
>
> Hi All,
> I am new to maven. I want to use it to get some kind of versioning
system
> going for our multi-project application.
> So far everything went smooth, but now i'm getting to the point where
i want
> to build jars for single projects which depend on other projects. My
> question is:
>
> how do i declare a dependency on another project instead of on a
jar-file?
>
> it seems to me maven is always looking for jars, which cant be built
because
> other jars are missing to compile and package them:
>
> Compiler output:
> Missing:
> ----------
> 1) net.tvrl.:burancore2:jar:0.1.1.1
>
>
> with POM entry:
>
>     <dependency>
>       <groupId>net.tvrl</groupId>
>       <artifactId>burancore2</artifactId>
>       <version>0.1.1.1</version>
>     </dependency>
>
>
> Of Course the Compiler cant find that jar, because it hasnt been
created
> yet. To create it, the burancore is dependent on other jars, which
> themselves don't exist.
> frustrating.
> Can anyone help?
>
> Thx
>
>
> --
> View this message in context:
>
http://www.nabble.com/Dependency-understanding-problem-tf4677961s177.htm
l#a13365897
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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


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


Re: Dependency understanding problem

Posted by Wayne Fay <wa...@gmail.com>.
You've got to start at the beginning. Go to the simplest jar that has
the fewest dependencies, build it, and install it (mvn install).

Then go to the next one (that probably has a dependency on the first
one) and do the same. Rinse and repeat until all jars build and are
installed.

If these are all part of the same larger project, then you should
probably have a parent pom with <modules> specified. Then when you
build from the top parent, Maven figures out the correct build graph
and things Just Work.

Wayne

On 10/23/07, Danni <dk...@tvrl.net> wrote:
>
> Hi All,
> I am new to maven. I want to use it to get some kind of versioning system
> going for our multi-project application.
> So far everything went smooth, but now i'm getting to the point where i want
> to build jars for single projects which depend on other projects. My
> question is:
>
> how do i declare a dependency on another project instead of on a jar-file?
>
> it seems to me maven is always looking for jars, which cant be built because
> other jars are missing to compile and package them:
>
> Compiler output:
> Missing:
> ----------
> 1) net.tvrl.:burancore2:jar:0.1.1.1
>
>
> with POM entry:
>
>     <dependency>
>       <groupId>net.tvrl</groupId>
>       <artifactId>burancore2</artifactId>
>       <version>0.1.1.1</version>
>     </dependency>
>
>
> Of Course the Compiler cant find that jar, because it hasnt been created
> yet. To create it, the burancore is dependent on other jars, which
> themselves don't exist.
> frustrating.
> Can anyone help?
>
> Thx
>
>
> --
> View this message in context:
> http://www.nabble.com/Dependency-understanding-problem-tf4677961s177.html#a13365897
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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