From f93b7e7059c2329b36aaffc847809464749009f5 Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Wed, 17 Mar 2004 21:20:31 +0000 Subject: [PATCH] adding file inclusion use case git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@162611 13f79535-47bb-0310-9956-ffa450edef68 --- USE-CASES.txt | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/USE-CASES.txt b/USE-CASES.txt index be1ab876ff..9653a74291 100644 --- a/USE-CASES.txt +++ b/USE-CASES.txt @@ -144,3 +144,43 @@ their source trees set up in the same way as their collegues. project out into multiple projects with a reactor, per the Maven 1 guidelines. But if this limitation was removed, it might help Marvin adoption. (PR) +- File inclusion in POM - project inheritance allows to factorize some common pom attributes, + however there are some cases where this mechanism is not enough. For instance we might want + to share common dependencies between projects whose ancestors union is empty. Providing poms + easier to read by extracting various elements into their own xml fragments is another example. + + afaik the only way to obtain this behaviour today is to use xml entities. There are some really + bad limitations to this system : + + * cannot use interpolation b/c doctype is processed before pom is interpolated + * if using reactor, there is no uniform way to declare the entities since it + depends badly on the multiproject structure (nested vs. parallel projects) + * being able to run maven from either parent project dir or subproject + dir is not straigthforward b/c we have to think about the directory structure + which is a low-level concern + + Also i dont know what is the behaviour when running from an arbitrary folder (-d, -p options) + + adding support for file inclusion in pom would provide simplification and better consistency + among pom base. + + POM could perhaps have an section : + + + + path_to_xml_fragment + toBeIncluded + + + + then we could reference the fragment with something like : + + toBeIncluded + + where path_to_xml_fragment would be relative to ${basedir}. another advantage is the + possibility to perform some filtering on the included files, for instance dependending + on some (build dependent) properties. + + the drawback of this proposal is the complexity it adds to the POM structure, polluting it + with non project related elements. + \ No newline at end of file