Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 155091 - Netbeans doesn't see packages inside a .jar generated with Maven plugin Shade
Netbeans doesn't see packages inside a .jar generated with Maven plugin Shade
Product: projects
Classification: Unclassified
Component: Maven
All All
: P3 with 1 vote (vote)
: 7.1
Assigned To: Jesse Glick
Depends on: 179521 208411
  Show dependency treegraph
Reported: 2008-12-10 03:44 UTC by lilianne_blaze
Modified: 2012-02-14 16:58 UTC (History)
1 user (show)

See Also:

Simple test project (9.07 KB, application/octet-stream)
2008-12-10 05:51 UTC, lilianne_blaze
Simple test project (9.07 KB, application/octet-stream)
2008-12-10 05:53 UTC, lilianne_blaze
ok (6.91 KB, image/png)
2008-12-10 06:09 UTC, lilianne_blaze
?? (18.19 KB, image/png)
2008-12-10 06:09 UTC, lilianne_blaze

Note You need to log in before you can comment on or make changes to this bug.
Description lilianne_blaze 2008-12-10 03:44:58 UTC
Netbeans doesn't see packages inside a .jar generated with Maven plugin Shade.
Project using such jar compiles correctly in both embedded and external Maven, but code completion fail with "Package
xxx does not exist".
Comment 1 lilianne_blaze 2008-12-10 05:51:45 UTC
Created attachment 74779 [details]
Simple test project
Comment 2 lilianne_blaze 2008-12-10 05:53:04 UTC
Created attachment 74780 [details]
Simple test project
Comment 3 lilianne_blaze 2008-12-10 06:08:45 UTC
I uploaded a simple project to demonstrate it. Part 1 is the application, part 3 is some 3rd party library, part 2 is
supposed to merge a couple 3rd party libraries and their dependencies into a single jar.

Compiling and running does work. Code completion - doesn't. So I guess it's something in Netbeans.

I should mention I'm still pretty new to Maven - it could be my fault, I could have written something that partially
works or works but is very non-standard. But then it shouldn't work at all?

Also, the tooltip for part 2 in Maven Explorer window looks a bit strange - packaging null, and where's the "GroupId"
text? It would imply Netbeans isn't detecting that jar correctly?
Comment 4 lilianne_blaze 2008-12-10 06:09:22 UTC
Created attachment 74781 [details]
Comment 5 lilianne_blaze 2008-12-10 06:09:50 UTC
Created attachment 74782 [details]
Comment 6 lilianne_blaze 2008-12-22 09:59:16 UTC
Any ideas what could cause it? Or at least if the bug is in Netbeans, Maven, or my pom?
Comment 7 Milos Kleint 2009-01-02 20:44:45 UTC
not really a bug anywhere I'd say, more likely a feature not supported by netbeans. not sure yet it it *can* be supported. 

1. The pom of shadetest1_2 is different in repository and sources, specifically the dependency section. Therefor the 1_3
project never, ever appears on the classpath on 3rd party projects that use 1_2.

2. The IDE relies on keeping track of opened projects and re-routing the source-for-binary queries for local repository
binaries. That's essential to features like: I do change in project A, and the IDE marks all classes in project B as

3. if the shadetest1_2 project is opened or otherwise accessible to the IDE (might not be directly opened, just
references by an opened project), we reroute the classpath to the project to get the uptodate state of 1_2. However that
one misses out the sources for 1_3, as these are hidden in 1_2 binary.

we might try putting both live sources and repository sources on classpath, but that needs to be deeply investigated, it
could have nasty side-effects.
Comment 8 Jaroslav Pospisil 2009-05-14 12:27:03 UTC
According to last comment and due to lack of user feedback changing to RFE.
Comment 9 Antonin Nebuzelsky 2010-07-30 15:17:07 UTC
Reassigning to default owner.
Comment 10 Jesse Glick 2010-08-19 00:10:25 UTC
The only thing I can think to do is to report preferSources=false from SourceForBinaryQuery on a repository artifact built using Shade. Thus Ctrl-B etc. would work but changes made in the upstream project would not be immediately reflected in the downstream project's code completion - you would need to install upstream first. Dependencies on projects not using Shade would be unaffected.
Comment 11 Jesse Glick 2011-08-09 21:15:12 UTC
core-main #c9b5f0699899
Comment 12 Quality Engineering 2011-08-10 21:35:23 UTC
Integrated into 'main-golden'
User: Jesse Glick <>
Log: #155091: Netbeans doesn't see packages inside a .jar generated with Maven plugin Shade
Treat an artifact from a project using Shade as preferred to its sources, unless shadedArtifactAttached=true.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo