Women in Technology

Hear us Roar

  Maven: Trove of Tips
Subject:   Almost a maven convert
Date:   2004-08-05 06:08:56
From:   tlaurenzo1
I was almost a maven convert a couple of months ago. Even though understated by the maven developers, I believe that the achilles heal is the constraint that each project can only produce one artifact. I know that there are philosophies all about this, but the truth of the matter is (as I have found it, anyway) that it is pretty convenient to be able to spit out multiple artifacts from time to time (think: rmi stubs, jax-rpc stubs, a lite and full version of a library). What's more is that many old projects do just this. Converting them to the "maven way" can be an exercise in futility.

When I stepped back from maven a bit, I found that the main feature I was using it for was autmatic dependency management. Even this left something to be desired since dependencies are not tracked recursively (ie. I cannot say go get apache axis 1.1, spring 1.0, or hibernate 2.0 without worrying about the dependency tree -- and the dependencies on those libraries is the hardest part to keep straight).

With this in mind, I set out to write some ant tasks/types that simulated the Maven dependency management and possibly extended it. A little way into my work, I read an article on the serverside about a tool called Savant that does just this (try to look past the line break problems in this article... it is a good read). It took me a couple of hours to figure it out, setup a site local repository and specify dependencies for my commonly used libraries (and submit a bug-fix for a FileNotFoundException when resolving library dependencies in some situations). Its really great because it works with the Ant classpath and fileset references instead of trying to tromp them. It also makes publishing arbitrary artifacts (with their dependencies) a snap. It does rely on ant 1.6, so its time to upgrade.

Anyway, that's just my observations. Your mileage will vary. I still use Maven for simple projects.

Full Threads Oldest First

Showing messages 1 through 4 of 4.

  • Almost a maven convert
    2004-09-04 14:41:37  khote [View]


    Break your EAR project into ear, war, jar, ejb-jar ... tld, ... docs .. whatever you want. by declaring one project's artifact as a dependency in another you can control the order of the build.
  • Almost a maven convert
    2004-08-09 10:47:01  schaefera [View]

    I agree that Maven has one shortcomming with dependencies because it does not support to add archives into the dependencies that are not provided in the local repository. But I do not think that would justify to use another tool. I split up the project so that every project creates one artifact that then can be used in other projects. For the external/local archives I used maven:addPath to the maven.dependencies.path.

    If you are going to use Ant then maybe Sarvant works for you but I do not think that Sarvant provides you with the functionality of the Maven plugins nor the scripting abilities of Jelly within Maven.

    Just my 2 cents - Andy (Author)
  • Savant
    2004-08-05 08:14:19  jimothy [View]

    That's for the info about Savant. I'm going to take a look at it.

    By the way, the "Printer Friendly Version" doesn't have the line break problems of the regular version:

    • Savant
      2004-08-06 08:53:58  jimothy [View]

      Oops...Thanks for the info.