On Sun, Jul 3, 2011 at 6:30 PM, Benson Margulies <bimargul...@gmail.com>wrote:

> I'm not sure that the operation you are asking for is well-defined.
> Shade combines, renames, and transforms, using arbitrary Java plugins
> that operate entirely on binaries, which can themselves be the output
> of, well, shade. Trying to read the source and perform the same
> transformations would be very, very, hard.
>
> You might be able to grab jarjar, a non-maven tool with similar
> capabilities, build it from source, and use it for these simple cases
> as part of your bootstrap. Or, for bootstrap, you could leave out the
> shading and just depend on Xerces unrenamed, go all the way around,
> build shade, and then rebuild.
>

I've ran jarjar with some samples and checked. This would indeed do the job.
I hope there is no concerning bugs. I see a bug report saying it fails with
ant 1.8.

Well, I'm going to go ahead with this. Thanks for the suggestion Benson!

--Kasun


>
> Or you might be able to cherry-pick the maven-shade-plugin source. It
> could be that there is a clean separation in there between code
> connected to the plugin framework and code that does the work.
>
> On Sun, Jul 3, 2011 at 7:38 AM, Kasun Gajasinghe <kasu...@gmail.com>
> wrote:
> > On Sun, Jul 3, 2011 at 4:23 PM, Benson Margulies <bimargul...@gmail.com
> >wrote:
> >
> >> I'm not sure what you are asking. Shade is a binary operation that
> >> uses asm. It renames packages. There is no feature of creating
> >> corresponding source.
> >>
> >
> > I see. It means what I asked is not possible. I wasn't aware that it's a
> > binary operation.
> > What I want to do is to relocate the packages such as
> > org.codehaus.plexus.util, org.apache.xerces that are shaded by maven in
> the
> > official build. As you know, these should be shaded, else these classes
> will
> > conflict with a different version of the same class that a project would
> be
> > using.
> >
> > Because of the approach we are taking, we can't invoke maven-shade-plugin
> > and get the job done. I think I'll have to manually patch the maven
> sources
> > to get the said functionality. Have to proceed on this track if there's
> no
> > other way. Can you please let me know the changes required to get this
> done?
> >
> > Thanks,
> > --Kasun
> >
> >
> > If you just want the original source, the plugin doesn't get into that
> >> business either, that would be a whole 'nother plugin.
> >>
> >> On Sun, Jul 3, 2011 at 6:39 AM, Kasun Gajasinghe <kasu...@gmail.com>
> >> wrote:
> >> > Hi,
> >> > Is it possible to have the .java source files which got shaded by
> >> > maven-shade-plugin? Currently,  it generates the uberjar without
> leaving
> >> the
> >> > shaded sources files. There's obviously an intermediary step in which
> >> these
> >> > source files will be transformed to shaded java packages like
> >> > hidden.org.codehaus.plexus.util.*.  So, like to know whether it's
> >> possible
> >> > to have those .java files. Any complications involved?
> >> >
> >> > [1] http://maven.apache.org/ref/2.2.1/apache-maven/dependencies.html
> >> >
> >> > Thanks,
> >> > --Kasun
> >> >
> >> > --
> >> > ~~~*******'''''''''''''*******~~~
> >> > Kasun Gajasinghe,
> >> > University of Moratuwa,
> >> > Sri Lanka.
> >> > Blog: http://blog.kasunbg.org
> >> > Twitter: http://twitter.com/kasunbg
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> >> For additional commands, e-mail: dev-h...@maven.apache.org
> >>
> >>
> >
> >
> > --
> > ~~~*******'''''''''''''*******~~~
> > Kasun Gajasinghe,
> > University of Moratuwa,
> > Sri Lanka.
> > Blog: http://blog.kasunbg.org
> > Twitter: http://twitter.com/kasunbg
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
>
>


-- 
~~~*******'''''''''''''*******~~~
Kasun Gajasinghe,
University of Moratuwa,
Sri Lanka.
Blog: http://blog.kasunbg.org
Twitter: http://twitter.com/kasunbg

Reply via email to