[Anthill-pro] Tighter Maven Integration

Jason Dillon jason at planet57.com
Thu Mar 15 12:11:19 CST 2007


On Mar 15, 2007, at 9:35 AM, Maciej Zawadzki wrote:
> Jason,
>
> This is good info, thanks for taking the time.

Sure.


> The proxy approach seems like it should work pretty well for
> provisioning the dependencies.  A simpler approach though would be to
> get the dependencies from the POM -- not sure whether that would  
> work in
> all cases though.

You can't really get the dependencies from the POM _easily_ with out  
executing mvn.  There are too many edge cases where plugins might  
download extra artifacts which are not listed in the modules  
<dependency> list (or in the plugins).

I think if you try to go down the path of scraping POM's for this...  
or really even using the mvn API directly to get pom details, then  
you will end up with holes in the list of your discovered  
dependencies.  I know... I've been down this path before, tried to  
get all the deps... its not easy.  And I have written a few plugins  
which have configurable set of artifacts which don't (and must not)  
be used in the normal <dependencies> list.

If you don't believe me I can make you an example where the  
<dependencies> list does not give you all of the artifacts ;-)  And I  
would really avoid trying to add custom bits for specific plugins  
(like to handle maven-dependency-plugins's artifactItems) because you  
simply will not be able to keep up with all of the plugins which use  
this technique.  And trying to do so will only make your tool more  
complicated internally and still less likely to discover the complete  
artifact set.

I really think your best bet is to implement the proxy-based  
solution.  Its simple and its going to work 100% of the time.


> We'll be working on figuring out the upside and
> downside of the two approaches.  Jason Schatz on our end will be  
> working
> on this piece.

If you want any more details I'm more than happy to share them.  I've  
been working on this problem for what seems like forever now.

  * * *

Using Proxy to Discover

     + more likely to work most of the time (if not all the time)
     + chances are the same basic system will work with maven1, maven2 
+, ivvy, etc (any remote repo thingy that has a configurable proxy)
     + will catch every artifact
     + relatively simple
     + requires no project configuration (its transparent)
     + AH will still need a way to inject artifacts from codestation,  
so using the proxy to discover also provides mechanism to inject (or  
apply policy transparently to build)

     - Lacks rich metadata as its only a URL, though easy enough to  
parse the URL ;-)

Using POM to Discover

     + Already richer metadata (gropuId/artifactId/version)...  
instead of just a URL

     - Requires complicated scanning of poms... which will not catch  
every artifact (even if you use the Maven API it wont')
     - Requires custom scanner/logic per repository type (scanner for  
maven1 is different than for maven2, etc)
     - Bugs/features in Maven may resolve artifacts differently than  
your discovery does (say for snapshots, etc).

Seems obvious to me which is the best direction ;-)

  * * *

Anyways, lemme know... I'm obviously interested in whatever you guys  
end up deciding in this area.  I just hope that its going to be  
complimentary with my harness so I can re-use your integration.

--jason



More information about the Anthill-pro mailing list