This is the direction that Maven 3.0 is moving toward, with the new project builder. You can create custom ModelTransformers that could do things like take the global exclusion and apply it to all dependencies. This could allow you to create extensions to the local pom but have it deployed as model version 4.0
Shane On Sat, Nov 22, 2008 at 5:12 AM, nicolas de loof <[EMAIL PROTECTED]> wrote: > Hi, > > considering the issue with a new modelVersion, that would not be readable > by > previous Maven versions, > What about enhancing the deploy plugin to rewrite the POM that gets > deployed > as 4.0.0 ? > > example : suppose we create a new <globalExclusion> element in modelVerison > 4.1.0. This could be translated to setting the exclusion to ALL > dependencies > in the POM, and writing this one back as 4.0.0. Not very nice, but who > cares > about the beauty of POMs on central ? They are use by maven as metadata > sources, not by human beeing. only the POM in project SCM has interest for > humans ! > > This requires 4.x modelVersion to be translatable to 4.0.0, but this could > introduce some interesting enhancements to POM that are blocked today. > > 2nd Idea (more complex) : could a maven extension post-process the POM ? > example : > My (custom) POM uses a dedicated namespace for some extension feature : > > <project> > ... > <ext:globalExclusion xmlns:ext="someURI" > artifact="commons-logging:commons-logging"> > ... > <extension> > <groupId>org.apache.maven.extensions</> > <artifactId>globalexclusion</> > <version>..</> > <extension> > </ > > Note : I suppose the default parser will ignore this unexpected <ext: > element. > > after parsing this POM, globalexclusion extension, that implements some > PostProcessor API could modify the parsed Model object, and in my example > add an exclusion to all declared dependencies. > > Just some week-end ideas ;) >
