Author Archives: shane

On Maven Model Transforms and C#


November 7, 2008 By shane

Maven 3.0 does all project model processing on a canonical data format, consisting of nearly 500 property values. Using a canonical data format makes it easy to do bidirectional transforms between the Maven pom and other model types.

To transform from an XML format to the property format, you can take any stream containing data in XML and pass it the static method ModelMarshaller.marshallXmlToModelProperties. In the case of the Visual Studio’s C# project file, it would look something like: Continue reading

Maven 3.0 Project Model and Mixins


By shane

The Apache Maven project model consists of a fairly rich model structure, consisting of 465 possible elements, specifying everything from the plugins Maven uses to build the project to the dependencies it needs for compiling. How Maven processes the model prior to a build can be a little confusing, dealing with the inheritance of parent poms (or the super pom), the applying of profiles, the merging in of dependency management information, to name just a few of the operations.

Back in May, Jason started talking to me about adding in mixin support for the pom, and it became clear that we needed to reconsider the Maven 2.0 design of project builder so that we could support such features. Maven 2.0 took the approach of merging trees of information (XML nodes), a perfectly reasonable approach for single inheritance. For things like mixins and multiple pom inheritance, linearizing the information proves a much simpler approach.  In this post I discuss the ramifications of linearizing POM information to support multiple inheritance for POMs.

Continue reading