Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 68218 invoked from network); 13 Oct 2008 11:56:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Oct 2008 11:56:56 -0000 Received: (qmail 85950 invoked by uid 500); 13 Oct 2008 11:56:56 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 85681 invoked by uid 500); 13 Oct 2008 11:56:55 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 85670 invoked by uid 99); 13 Oct 2008 11:56:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Oct 2008 04:56:55 -0700 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [66.111.4.28] (HELO out4.smtp.messagingengine.com) (66.111.4.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Oct 2008 11:55:47 +0000 Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id CB69E1783C1 for ; Mon, 13 Oct 2008 07:56:23 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 13 Oct 2008 07:56:23 -0400 X-Sasl-enc: h3RLbHuMnXzEdDrRwYIvQbP/Cnw9tPszk1njq+9lrZ/W 1223898983 Received: from [192.168.178.24] (pD95345A6.dip.t-dialin.net [217.83.69.166]) by mail.messagingengine.com (Postfix) with ESMTPSA id EF22922E65 for ; Mon, 13 Oct 2008 07:56:22 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v753.1) Content-Transfer-Encoding: 7bit Message-Id: <14DE0955-E056-4E25-B9F4-8A6A8C020963@dockter.biz> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: dev@ant.apache.org From: Hans Dockter Subject: Generating a Maven pom from Ivy Date: Mon, 13 Oct 2008 13:56:47 +0200 X-Mailer: Apple Mail (2.753.1) X-Virus-Checked: Checked by ClamAV on apache.org Hi, I have submitted code into the Gradle trunk for auto generating a Maven pom descriptor file from an Ivy ModuleDescriptor. This code is all on the Ivy API level. Not everything we want to implement is implemented yet. We are happy to offer this code eventually to the Apache Ivy project (there is some code in Ivy for generating a pom out of ivy objects but this code is pretty limited and was not usable for our purpose). What our code does: One challenge is how to map between configurations and scopes, as dependencies can belong to more than one configuration. In our code we allow to map a configuration to one and only one scope. Different configurations can be mapped to more than one scope. One can assign also a priority to a particular mapping. Let's look at a couple of cases: - A dependency belongs to only one configuration: The first thing we check is whether there is a mapping for this configuration. If there is none, the dependency is by default not added to the pom. By setting the global property 'includeUnmappedConfigurations' to true such a dependency would be added. If the configuration is mapped, the scope mapping is clear and the dependency is added. - A dependency belongs to more than one mapped configuration: If the mapped configurations map to the same scope the situation is clear. If the mapped configurations map to different scopes the configuration mapping with the highest priority is chosen. If there is more than one configuration with a highest priority and they map to different scopes an exception is thrown. Exclude Rules: Our code has an exclude rule converter. This converter gets an Ivy exclude rule and returns a Maven exclude rule or null. If null is returned the exclude rule is not reflected in the pom. The current simple logic of the converter is, that it returns a non null value if the Ivy exclude rule uses an exact matcher and the name as well as the organization of the module is specified. Functionality that is still missing: - Integrating the new Ivy 'override' rules the same way as the exclude rules. - Artifact dependencies are not mapped yet. - Fine grained customization The last point I think is very important. Due to the more powerful elements Ivy has and many , often subtle, differences between Ivy and Maven, auto generation can't always produce the result that is needed. What we want to enable is that the user can modify any property of an auto generated Maven dependency element. Customization should also allow to remove auto generated elements as well as add new elements. One thing we want to provide is a conversion listener. A hook would getdev all the created MavenDependency object and can analyze and modify them. Alternatively such a hook can provide a 'query by example' filter to get only a subset of the generated MavenDependency elements. Feedback is welcome - Hans -- Hans Dockter Gradle Project lead http://www.gradle.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org