Bug 203536 - Add local source to Maven dependency does not allow navigate to source
Add local source to Maven dependency does not allow navigate to source
Status: RESOLVED INCOMPLETE
Product: projects
Classification: Unclassified
Component: Maven
7.0.1
PC Linux
: P3 with 1 vote (vote)
: TBD
Assigned To: Jesse Glick
issues@projects
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-11 16:03 UTC by MikeJansenNEC
Modified: 2011-10-31 14:50 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments
screenshot: source jar in local repo (5.62 KB, image/png)
2011-10-11 16:04 UTC, MikeJansenNEC
Details
screenshot - maven plugin version (35.46 KB, image/png)
2011-10-11 16:04 UTC, MikeJansenNEC
Details
screenshot: shows sources attached to dependency #1 (8.75 KB, image/png)
2011-10-11 16:05 UTC, MikeJansenNEC
Details
screenshot: shows sources attached to dependency #2 (9.12 KB, image/png)
2011-10-11 16:05 UTC, MikeJansenNEC
Details
screenshot: navigating to source #1 (11.69 KB, image/png)
2011-10-11 16:06 UTC, MikeJansenNEC
Details
screenshot: navigating to source #2 (22.11 KB, image/png)
2011-10-11 16:06 UTC, MikeJansenNEC
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MikeJansenNEC 2011-10-11 16:03:18 UTC
I have atlassian-jira.4.4.1 dependency and have downloaded the source (we have a license) and right clicked on the dependency and did "Add Local Source". 

The source shows up in my local Maven repo, so I know that worked.

However, if I navigate to anything in that dependency, I just get the reflected Java stubs and not the attached source.

Ubuntu 11.04 (GNU/Linux 2.6.38-11-generic-pae i686)
NetBeans IDE 7.0.1 (Build 201107282000)
Java 1.6.0_24; Java HotSpot(TM) Client VM 19.1-b02

Attachments to follow.
Comment 1 MikeJansenNEC 2011-10-11 16:04:10 UTC
Created attachment 111870 [details]
screenshot: source jar in local repo
Comment 2 MikeJansenNEC 2011-10-11 16:04:39 UTC
Created attachment 111871 [details]
screenshot - maven plugin version
Comment 3 MikeJansenNEC 2011-10-11 16:05:32 UTC
Created attachment 111872 [details]
screenshot: shows sources attached to dependency #1
Comment 4 MikeJansenNEC 2011-10-11 16:05:48 UTC
Created attachment 111873 [details]
screenshot: shows sources attached to dependency #2
Comment 5 MikeJansenNEC 2011-10-11 16:06:24 UTC
Created attachment 111874 [details]
screenshot: navigating to source #1
Comment 6 MikeJansenNEC 2011-10-11 16:06:43 UTC
Created attachment 111875 [details]
screenshot: navigating to source #2
Comment 7 athompson 2011-10-11 16:29:20 UTC
irritating, but I'm not sure this is a P2. :)
Comment 8 Jesse Glick 2011-10-12 19:46:20 UTC
Without access to the sources myself, I cannot diagnose for sure. My best guess is that your atlassian-jira-4.4.1-sources.jar is not in the correct format; for example, com/atlassian/jira/plugin/report/impl/AbstractReport.java is not a ZIP entry.
Comment 9 athompson 2011-10-12 22:52:15 UTC
I independently had the same issue myself.  I tried several different file names and directory structures for the docs jar, including exactly mimicking the docs jars of other items in the repository.  Is it possible that it won't show up until you manually reindex the local repository?  I didn't try that...
Comment 10 MikeJansenNEC 2011-10-13 12:01:19 UTC
Jesse's observation on the structure of the .jar is correct in my case.  The source archive provided by Atlassian for JIRA is not compatible.

I am currently building JIRA from source and executing 'atlas-mvn source:jar' and will then manually install those locally (I'm not a maven wizard so I don't know how to get the source jars into the local repo without manually editing each of the 100 pom files before calling 'atlas-mvn install' to include the source jars in the deployment).

athompson:  I would expect you would have to manually re-index the local repository.  I have done that each time I have made changes to the local repo since I didn't see any background task doing it.

I've conceded this isn't a P2, but if it actually is a bug (and not just a PEBCAK), it's more than irritating: it drastically reduces productivity.
Comment 11 athompson 2011-10-28 17:01:54 UTC
If you have to reindex manually that's still a bug IMO, so can we reopen?
Comment 12 Jesse Glick 2011-10-29 01:02:44 UTC
There should be no need to reindex the local repository so far I as know. As soon as jar:file:/home/mike-jansen/.m2/repository/com/atlassian/jira/atlassian-jira/4.4.1/atlassian-jira-4.4.1-sources.jar!/com/atlassian/jira/plugin/report/impl/AbstractReport.java exists, the IDE should be able to find it.
Comment 13 athompson 2011-10-31 14:19:44 UTC
Hmm, it doesn't work for me.  Mike, how exactly did you get it to work?
Comment 14 MikeJansenNEC 2011-10-31 14:50:31 UTC
I haven't gotten it to work yet.  The maven projects for the dependencies that I'm dealing with aren't creating the source jar properly that I need and I haven't had time to get back and resolve it.  I don't know that it doesn't work, I just haven't had a chance to determine if it does.


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