You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Lilianne E. Blaze" <li...@lilianne-blaze.net> on 2008/12/11 04:41:27 UTC

Maven Shaded Jars + Netbeans = confused Netbeans?

Hello,
(I already tried on users- list)

I'm trying to make a jar containing x dependencies to be used as a
single dependency, using Shade with the following options:

<createSourcesJar>true</createSourcesJar>
<keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>

It seems ok, looks ok, works ok. _But_ - Netbeans doesn't seem to
recognize it - code completion fails with "package/class/symbol does not
exist" errors all over the place. Now I'm pretty much stuck. It could be
a problem with Maven, could be with Netbeans, could be my (complete or
partial) mistake with understanding how Maven makes / handles Shaded jars.

I already submitted a report at
http://www.netbeans.org/issues/show_bug.cgi?id=155091 , along with a
simple project (3 projects, 2 classes) to demonstrate it.

Greetings, thanks in advance, Lilianne



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven Shaded Jars + Netbeans = confused Netbeans?

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday 11 December 2008 4:26:42 pm Lilianne E. Blaze wrote:
> Daniel Kulp wrote:
> > Could you try unzipping the shaded jar and then using "jar cf"  to create
> > a new jar using the same contents and seeing if that helps?
>
> Thanks.
> It seems it doesn't help.

OK.   Then that's not the issue.    The new jar would definitely have 
everything in there correctly.


>
> > At one point, shade wasn't sticking directory entries into the jar
> > properly which worked fine for "java" and "javac" and such, but it
> > confused winzip really badly.     It's possible something else or a
> > similar issue is causing an issue with netbeans.
>
> I think I remember reading about it, wasn't it fixed before 1.2?

Yea.  1.1 I think.

Dan



>
> > Alos, make sure it's the latest shade plugin as well to get the fix for
> > above.
>
> 1.2?
>
> I saw references to 1.3-SNAPSHOT, but I have no idea how to declare and
> use it in my own .pom?
>
> Greetings, L
>
> > Dan
> >
> > On Wednesday 10 December 2008 10:41:27 pm Lilianne E. Blaze wrote:
> >> Hello,
> >> (I already tried on users- list)
> >>
> >> I'm trying to make a jar containing x dependencies to be used as a
> >> single dependency, using Shade with the following options:
> >>
> >> <createSourcesJar>true</createSourcesJar>
> >> <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedSco
> >>pe> <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
> >>
> >> It seems ok, looks ok, works ok. _But_ - Netbeans doesn't seem to
> >> recognize it - code completion fails with "package/class/symbol does not
> >> exist" errors all over the place. Now I'm pretty much stuck. It could be
> >> a problem with Maven, could be with Netbeans, could be my (complete or
> >> partial) mistake with understanding how Maven makes / handles Shaded
> >> jars.
> >>
> >> I already submitted a report at
> >> http://www.netbeans.org/issues/show_bug.cgi?id=155091 , along with a
> >> simple project (3 projects, 2 classes) to demonstrate it.
> >>
> >> Greetings, thanks in advance, Lilianne
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org



-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven Shaded Jars + Netbeans = confused Netbeans?

Posted by "Lilianne E. Blaze" <li...@lilianne-blaze.net>.
Daniel Kulp wrote:
> Could you try unzipping the shaded jar and then using "jar cf"  to create a 
> new jar using the same contents and seeing if that helps?

Thanks.
It seems it doesn't help.

> 
> At one point, shade wasn't sticking directory entries into the jar properly 
> which worked fine for "java" and "javac" and such, but it confused winzip 
> really badly.     It's possible something else or a similar issue is causing 
> an issue with netbeans.

I think I remember reading about it, wasn't it fixed before 1.2?

> 
> Alos, make sure it's the latest shade plugin as well to get the fix for above.  

1.2?

I saw references to 1.3-SNAPSHOT, but I have no idea how to declare and
use it in my own .pom?

Greetings, L

> 
> Dan
> 
> 
> On Wednesday 10 December 2008 10:41:27 pm Lilianne E. Blaze wrote:
>> Hello,
>> (I already tried on users- list)
>>
>> I'm trying to make a jar containing x dependencies to be used as a
>> single dependency, using Shade with the following options:
>>
>> <createSourcesJar>true</createSourcesJar>
>> <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
>> <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
>>
>> It seems ok, looks ok, works ok. _But_ - Netbeans doesn't seem to
>> recognize it - code completion fails with "package/class/symbol does not
>> exist" errors all over the place. Now I'm pretty much stuck. It could be
>> a problem with Maven, could be with Netbeans, could be my (complete or
>> partial) mistake with understanding how Maven makes / handles Shaded jars.
>>
>> I already submitted a report at
>> http://www.netbeans.org/issues/show_bug.cgi?id=155091 , along with a
>> simple project (3 projects, 2 classes) to demonstrate it.
>>
>> Greetings, thanks in advance, Lilianne
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven Shaded Jars + Netbeans = confused Netbeans?

Posted by Daniel Kulp <dk...@apache.org>.
Could you try unzipping the shaded jar and then using "jar cf"  to create a 
new jar using the same contents and seeing if that helps?

At one point, shade wasn't sticking directory entries into the jar properly 
which worked fine for "java" and "javac" and such, but it confused winzip 
really badly.     It's possible something else or a similar issue is causing 
an issue with netbeans.

Alos, make sure it's the latest shade plugin as well to get the fix for above.  

Dan


On Wednesday 10 December 2008 10:41:27 pm Lilianne E. Blaze wrote:
> Hello,
> (I already tried on users- list)
>
> I'm trying to make a jar containing x dependencies to be used as a
> single dependency, using Shade with the following options:
>
> <createSourcesJar>true</createSourcesJar>
> <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
> <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
>
> It seems ok, looks ok, works ok. _But_ - Netbeans doesn't seem to
> recognize it - code completion fails with "package/class/symbol does not
> exist" errors all over the place. Now I'm pretty much stuck. It could be
> a problem with Maven, could be with Netbeans, could be my (complete or
> partial) mistake with understanding how Maven makes / handles Shaded jars.
>
> I already submitted a report at
> http://www.netbeans.org/issues/show_bug.cgi?id=155091 , along with a
> simple project (3 projects, 2 classes) to demonstrate it.
>
> Greetings, thanks in advance, Lilianne
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org



-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven Shaded Jars + Netbeans = confused Netbeans?

Posted by Milos Kleint <mk...@gmail.com>.
if the project in question is opened (or otherwise known), all queries
are redirected to it. That way you get the correct error badges in
project B when you change classses in project A..

Milos

On Thu, Dec 11, 2008 at 9:30 AM, Lilianne E. Blaze
<li...@lilianne-blaze.net> wrote:
> Milos Kleint wrote:
>> I'll look into it when I get back from vacation (Jan 2009).
>> Right now it seems to be an issue with the fact that the shaded jar
>> belongs to a project that doens't provide the source for the binaries
>> contained. That's sort of a concept in netbeans project system, so
>> making it work will probably involve some hacking..
>>
>> Milos
>
> I think that shouldn't matter?
> 1) Netbeans works correctly with 3rd party libs with no sources
> provided, and by default does not retrieve sources 2)
> <createSourcesJar>true</createSourcesJar> creates such jar, and from
> what I looked inside it, it looks just like a "normal" sources jar.
>
> Greetings, L
>
>>
>> On Thu, Dec 11, 2008 at 4:41 AM, Lilianne E. Blaze
>> <li...@lilianne-blaze.net> wrote:
>>> Hello,
>>> (I already tried on users- list)
>>>
>>> I'm trying to make a jar containing x dependencies to be used as a
>>> single dependency, using Shade with the following options:
>>>
>>> <createSourcesJar>true</createSourcesJar>
>>> <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
>>> <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
>>>
>>> It seems ok, looks ok, works ok. _But_ - Netbeans doesn't seem to
>>> recognize it - code completion fails with "package/class/symbol does not
>>> exist" errors all over the place. Now I'm pretty much stuck. It could be
>>> a problem with Maven, could be with Netbeans, could be my (complete or
>>> partial) mistake with understanding how Maven makes / handles Shaded jars.
>>>
>>> I already submitted a report at
>>> http://www.netbeans.org/issues/show_bug.cgi?id=155091 , along with a
>>> simple project (3 projects, 2 classes) to demonstrate it.
>>>
>>> Greetings, thanks in advance, Lilianne
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven Shaded Jars + Netbeans = confused Netbeans?

Posted by "Lilianne E. Blaze" <li...@lilianne-blaze.net>.
Milos Kleint wrote:
> I'll look into it when I get back from vacation (Jan 2009).
> Right now it seems to be an issue with the fact that the shaded jar
> belongs to a project that doens't provide the source for the binaries
> contained. That's sort of a concept in netbeans project system, so
> making it work will probably involve some hacking..
> 
> Milos

I think that shouldn't matter?
1) Netbeans works correctly with 3rd party libs with no sources
provided, and by default does not retrieve sources 2)
<createSourcesJar>true</createSourcesJar> creates such jar, and from
what I looked inside it, it looks just like a "normal" sources jar.

Greetings, L

> 
> On Thu, Dec 11, 2008 at 4:41 AM, Lilianne E. Blaze
> <li...@lilianne-blaze.net> wrote:
>> Hello,
>> (I already tried on users- list)
>>
>> I'm trying to make a jar containing x dependencies to be used as a
>> single dependency, using Shade with the following options:
>>
>> <createSourcesJar>true</createSourcesJar>
>> <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
>> <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
>>
>> It seems ok, looks ok, works ok. _But_ - Netbeans doesn't seem to
>> recognize it - code completion fails with "package/class/symbol does not
>> exist" errors all over the place. Now I'm pretty much stuck. It could be
>> a problem with Maven, could be with Netbeans, could be my (complete or
>> partial) mistake with understanding how Maven makes / handles Shaded jars.
>>
>> I already submitted a report at
>> http://www.netbeans.org/issues/show_bug.cgi?id=155091 , along with a
>> simple project (3 projects, 2 classes) to demonstrate it.
>>
>> Greetings, thanks in advance, Lilianne
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven Shaded Jars + Netbeans = confused Netbeans?

Posted by Milos Kleint <mk...@gmail.com>.
I'll look into it when I get back from vacation (Jan 2009).
Right now it seems to be an issue with the fact that the shaded jar
belongs to a project that doens't provide the source for the binaries
contained. That's sort of a concept in netbeans project system, so
making it work will probably involve some hacking..

Milos

On Thu, Dec 11, 2008 at 4:41 AM, Lilianne E. Blaze
<li...@lilianne-blaze.net> wrote:
> Hello,
> (I already tried on users- list)
>
> I'm trying to make a jar containing x dependencies to be used as a
> single dependency, using Shade with the following options:
>
> <createSourcesJar>true</createSourcesJar>
> <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
> <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
>
> It seems ok, looks ok, works ok. _But_ - Netbeans doesn't seem to
> recognize it - code completion fails with "package/class/symbol does not
> exist" errors all over the place. Now I'm pretty much stuck. It could be
> a problem with Maven, could be with Netbeans, could be my (complete or
> partial) mistake with understanding how Maven makes / handles Shaded jars.
>
> I already submitted a report at
> http://www.netbeans.org/issues/show_bug.cgi?id=155091 , along with a
> simple project (3 projects, 2 classes) to demonstrate it.
>
> Greetings, thanks in advance, Lilianne
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven Shaded Jars + Netbeans = confused Netbeans?

Posted by "Lilianne E. Blaze" <li...@lilianne-blaze.net>.
Hello,
Any ideas what could cause it?
Any hints, workarounds, anything?

Greetings, L

Lilianne E. Blaze wrote:
> Hello,
> (I already tried on users- list)
> 
> I'm trying to make a jar containing x dependencies to be used as a
> single dependency, using Shade with the following options:
> 
> <createSourcesJar>true</createSourcesJar>
> <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
> <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
> 
> It seems ok, looks ok, works ok. _But_ - Netbeans doesn't seem to
> recognize it - code completion fails with "package/class/symbol does not
> exist" errors all over the place. Now I'm pretty much stuck. It could be
> a problem with Maven, could be with Netbeans, could be my (complete or
> partial) mistake with understanding how Maven makes / handles Shaded jars.
> 
> I already submitted a report at
> http://www.netbeans.org/issues/show_bug.cgi?id=155091 , along with a
> simple project (3 projects, 2 classes) to demonstrate it.
> 
> Greetings, thanks in advance, Lilianne
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org