Hi guys,

Working on the tests for FlashImpl, I ran into a problem with the
AbstractAttributeMap (MYFACES-2840). After fixing it, I needed to copy my
changes over to myfaces-test to be able to use the new version in the test
case (MYFACESTEST-21). And this copying really sucks...

If you think about it there are many, many, many different places in the
whole MyFaces project where we have duplicate code, for example
package-private, unspecified classes on myfaces-api which also exist in
myfaces-impl, classes of myfaces-impl which are used for the mock
implementations of myfaces-test, or the biggest one: the shared project.

An introduction to the maven-shade-plugin: This plugin lets you use a
dependency to another project and then at build time it copies all needed
classes to the created jar file, removes the dependency from the pom.xml and
changes the imports in the class files. Thus you work with the real classes
at development time and then at build time the used classes are copied into
the artifact and the development dependency is gone. Furthermore you can
make all kinds of alterations to those classes (e.g. change package).

We successfully use the maven-shade-plugin in MyFaces CODI to reuse
functionaltiy between the JSF 1.2 and 2.0 modules. In addition, I have
locally already used it to fix MYFACESTEST-21: I use it to get the
AbstractAttributeMap and all its related classes from myfaces-impl to
myfaces-test. And it really works like a calm.

However I have to be honest, one thing currently has a bug: filters are only
applied to the binary and not also to the sources jar (see
http://jira.codehaus.org/browse/MSHADE-83), but I already provided a patch
and a test case for it, so I guess it will be fixed very soon.

So if there are no objects, I would like to introduce the maven-shade-plugin
on myfaces-test at first, to show you guys how awesome it is. Afterwards,
and of course if you all like it, I would really like to use it on several
places in MyFaces. This would for example be the chance to get rid of the
shared project once and for all.

Opinions, suggestions and tomatoes are welcome!

Regards,
Jakob

-- 
Jakob Korherr

blog: http://www.jakobk.com
twitter: http://twitter.com/jakobkorherr
work: http://www.irian.at

Reply via email to