The point I am making is that if you have all those jars together something is 
not going to work correctly.  SLF4J only allows one logging implementation. If 
you have all of SLF4J's jars, including the binding for Log4j as well as 
Logback, then SLF4J will throw a runtime exception. 

Commons Logging also has quirks. If Log4j is present then it will be used by 
default, otherwise it will do something else.

When you start dumping a whole bunch of jars together in one directory you had 
better understand how they are all going to relate to each other.

Ralph

On Jul 3, 2011, at 10:54 AM, Kasun Gajasinghe wrote:

> On Sun, Jul 3, 2011 at 10:42 PM, Ralph Goers 
> <ralph.go...@dslextreme.com>wrote:
> 
>> Out of curiosity, you said you are putting building your jars and putting
>> them in a shared library. What are you going to do with SLF4J, Log4J,
>> Commons Logging and Logback?
>> 
> 
> slf4j, commons-logging etc. will also be installed at /usr/share as usual.
> Maven needs to shade these jars and few others. So, these jars will be
> shaded, and packaged together to make an uber-jar. slf4j, commons-logging
> system jars won't be changed. What exactly the point you are trying to make?
> 
> And, how does log4j and Logback relates to core maven? I haven't seen these
> as dependencies!
> 
> --Kasun
> 
> 
>> 
>> Ralph
>> 
>> On Jul 3, 2011, at 9:57 AM, Kasun Gajasinghe wrote:
>> 
>>> 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
>> 
>> 
>> ---------------------------------------------------------------------
>> 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

Reply via email to