On Fri, Feb 29, 2008 at 1:29 PM, ant elder <[EMAIL PROTECTED]> wrote:
> On Fri, Feb 29, 2008 at 12:22 PM, Simon Laws <[EMAIL PROTECTED]> > wrote: > > > On Fri, Feb 29, 2008 at 11:58 AM, Venkata Krishnan < > [EMAIL PROTECTED]> > > wrote: > > > > > Hi, > > > > > > Yes the shade transformer that we use there just about aggregates the > > > contents of all files found with the path that we specify there. So > it > > > also > > > ends up aggregating the definitions.xml just as a text file. So this > > ends > > > up with multiple <sca:definitions> elements and then no root element > in > > > the > > > aggregated definitions.xml. This is where the problem started. > > > > > > I am looking at a XMLAppender that Ant pointed out. Let me see how it > > > goes. Otherwise I want to try our own shade transformer. > > > > > > Thanks > > > > > > - Venkat > > > > > > On Fri, Feb 29, 2008 at 2:38 PM, Simon Laws <[EMAIL PROTECTED] > > > > > wrote: > > > > > > > snip... > > > > > > > > > Could we just add our own Shade transformer that knows how to > > > aggregate > > > > > the > > > > > definitions files? Eg TO SUPPORT something like this in the shade > > > plugin > > > > > config: > > > > > > > > > > <transformer implementation=" > > > > > org.apache.tuscany.sca.tools.ShadeDefinitionsTransformer"> > > > > > <resource>META-INF/services/definitions.xml</resource> > > > > > </transformer> > > > > > > > > > > > > > I hadn't noticed the list of shader transformer configurations > before > > in > > > > the > > > > distribution/bundle pom. How does the appending transformer get > > applied > > > to > > > > definitions.xml as it stands. Is this just default behaviour? > > > > > > > > Simon > > > > > > > > > > > So why do we specify transformers for some things and not for others. > All > > the transformers specified are "AppendingTransformer" which I assume is > > what > > is appending the definitions.xml files together by default. > > > > Simon > > > > I'm not sure i understand what you're asking but here's what i understand > happens: > > The shade plugin is configured in the distribution/bundle/pom.xml. In > there > we say set the shadedGroupFilter as org.apache.tuscany so all the > dependencies in that group get processed by the plugin and by default it > will just take all the files in those resources and munged them into the > one > jar built for the bundle module. That works fine for most files as they > have > unique names but for files that are duplicated the default will i guess be > that the last one processed overwrites the others so all the contents of > all > the other files gets lost. To fix that we configure a transformer that > deals > with what to do. For example, we use the AppendingTransformer for all our > meta-inf/services files and that just takes the contents of the named file > for each it finds it appends the contents into a single file. That works > fine for text files but for xml files like definitions.xml there needs to > be > a way to merge the file contents not to just append the contents at the > end. > > > ...ant > Thank you for that ant. For what Venkat is saying it would appear that the default behaviour, at least for definitions.xml, is to concatenate that as well and I was asking why the pom specifically ask for some files to be concatenated while other concatenations happen by default. But thanks for all the details. I know enough now to not worry specifically about the answer to this question as Venkat's proposal looks good. Simon
