DZone Forums
Go Back   DZone Forums > Community > Languages & Frameworks > Java
Reload this Page Dependency management, why it's so difficult ?
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Apr 2008
Default Dependency management, why it's so difficult ? - 07-24-2008, 08:02 AM

Anybody could explain me why do you use maven. As I understand the main purpose of maven is a support of dependencies between modules/components in project. Other task such as reporting, documentation and others is not important. In this case it would be much more useful/simple to use less complicated tool. But it looks like there is no such one, I looked at Ant Ivy - it is simpler but for me it is not enough
As a developer I should provide two files for my module
  1. build.xml is used to build module
  2. module.xml describes module dependencies
For example module.xml describes dependencies in two scopes: production and test
HTML Code:
<module name="module1" version="1.2.3.4">
    <production>
        <dependency name="module3" version="1.2.3"/>
        <dependency name="module5" version="1.2.2"/>
        <dependency name="module7" version="1.2.12"/>
    </production>
    <test>
        <dependency name="module23" version="1.2.4"/>
        <dependency name="module27" version="1.2.9"/>
    </test>
</module>
If every module in project will provide such metainf it is very easy to create build.xml (for example it wiil contain a series of ant calls of build.xml for every component included into build) to build complete project. That is all what you need, no maven, no ivy - just simple tool.
What do you think, may be I too simplified a problem, I am not sure but I do not see any resons to use maven.
Reply With Quote
  (#2 (permalink)) Old
Member
 
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jul 2008
Default 07-25-2008, 04:13 AM

If you ever worked on a project with more than one developer, and found out that your product worked if you built it on your machine, but not on anyone else's machine, even if they have the same code, only then you will appreciate maven.

Maven is about much more than just in-project dependencies. It's also about unifying external dependencies (where to download them from, ...), build tool configuration, source code organisation, etc. Whatever it takes to make sure that a build is reproducible.
Reply With Quote
  (#3 (permalink)) Old
Member
 
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jul 2008
Default maven - 07-25-2008, 07:51 AM

You can use the dependecy mgmt feature of maven without all of its other features. Check out the maven ant tasks. They allow you to get a set of jars using the pom.xml declared dependencies and put them wherever you want. You can then use ant to continue the rest of your build process- build/test/whatever.
No maven straightjacket.

__James
Reply With Quote
  (#4 (permalink)) Old
Member
 
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Apr 2008
Default 07-28-2008, 02:32 AM

Hi, yes, I know that maven is more than than just in-project dependencies, but I think most projects need just dependency management, other features (like a project site, documentations and others) are not used in most projects. But maven, from one side simplified project development, from other side (when you need some specific processing) it complicates you life.
Reply With Quote
  (#5 (permalink)) Old
Member
 
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Apr 2008
Default 07-28-2008, 02:35 AM

Hi, James, I will try - thanks
Reply With Quote
  (#6 (permalink)) Old
Member
 
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Apr 2008
Default 07-28-2008, 07:59 AM

I looked at maven ant tasks, it looks like what I want, but there is a little problem with it, I have to declare used version in two places in build.xml in "artifact:dependencies" task and in pom file, first dependency is used in build process and second when I need deploy artifact to a repository - it looks strange as minimum since I declared dependencies already (in build.xml).
Reply With Quote
  (#7 (permalink)) Old
Member
 
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Apr 2008
Default 07-28-2008, 08:26 AM

Sorry I have made a mistake - maven ant tasks is really what I need. In build.xml I can declare reference to pom.xml
<artifactom id="pom" file="pom.xml" />
<artifact:dependencies pathId="test.class.path" useScope="test" pomRefId="pom"/>
Thanks
Reply With Quote
Reply

Tags
ivy, maven

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
rcp plugin dependency on non-plugin project Shefali23 Eclipse 1 07-24-2008 06:06 AM
cheat sheet: dependency between tasks has no effect japolo Eclipse 0 06-20-2008 01:02 PM
Eclipse project management dominity Eclipse 0 04-10-2008 05:58 AM
Eclipse Plugin For SQL/DB management sarahoconnell Eclipse 7 02-15-2008 02:09 PM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com