On Mar 12, 2008, at 10:08 PM, Wardrip, Paul wrote:

I am working on a new build process for my company using Ivy and an Archiva (Maven2 based) repository. I use the Ibiblio resolver to read and SFTP to publish. SFTP is not ideal, but I read that webdav support was currently broken in Ivy 2.0. I need to deploy projects in a Maven2 format for the repository and other users. I made some changes to the MakePom task to handle projects with multiple artifacts. I thought they may be useful so I wanted to pass them along.

Maven2 won't create more than one uniquely named artifact for a project, unless you set the packaging to "pom". Then you have a separate pom for each of the artifacts, referencing the project pom with a parent tag. They would get deployed like this:

/myorg/mymodule/1.0/mymodule-1.0.pom
/myorg/artifact-core/1.0/artifact-core-1.0.pom
/myorg/artifact-core/1.0/artifact-core-1.0.jar
/myorg/artifact-util/1.0/artifact-util-1.0.pom
/myorg/artifact-util/1.0/artifact-util-1.0.jar

I changed the MakePom task to build separate poms when it detects uniquely named artifacts. I have 2 patterns for my SFTP resolver. The default pattern is used when there are no declared artifacts or when the artifact name matches the module name. I have the task setting a property "ivy.pom.descriptor.size" with the number of poms that were generated.

Wouldn't this property be better named "ivy.pom.descriptor.count"? (Yes, I'm one of those people who kvetch about "less" v/s "fewer".)
I use this property to decide which pattern to use:

Default Pattern: /[organization]/[module]/[revision]/[module]- [revision].[ext] Multi Artifact: /[organization]/[artifact]/[revision]/[artifact]- [revision].[ext]

This works very well for my build process and repository, the only thing that would be better is a resolver for Maven2 that does all of this automatically. A good Maven2 resolver should build and publish the poms automatically, without calling MakePom or declaring them as artifacts. Use the Ibiblio functionality for reads, webdav for writes and handle multiple artifact projects with a different pattern.

------------
Paul Wardrip
Software Engineer, OpenStream
TANDBERG Television | Part of the Ericsson Group
4500 River Green Parkway | Duluth | GA 30096
Mobile: 770-312-2852 | AIM: paulwardrip
Email: [EMAIL PROTECTED] | www.tandbergtv.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--=_reb-r5506C275-t47D85489--

Reply via email to