This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 195336 - It seems that an externally included project (as lib) into another project is not correctly referred by the editor
Summary: It seems that an externally included project (as lib) into another project is...
Status: RESOLVED DUPLICATE of bug 47507
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 normal (vote)
Assignee: Dusan Balek
Depends on:
Reported: 2011-02-11 15:01 UTC by enrichicco
Modified: 2011-02-16 14:39 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:

test case with PRJ-A and PRJ-B (3.37 MB, application/octet-stream)
2011-02-11 15:02 UTC, enrichicco

Note You need to log in before you can comment on or make changes to this bug.
Description enrichicco 2011-02-11 15:01:00 UTC
I added, in the lib folder of a Netbeans (6.9.1) java-library project (lets say PRJ-A) the jar generated by another java-application project.

I also modified build.xml in PRJ-B, in order to add, in its jar, the base libs of PRJ-B itself (just as an example, at the moment, the apache-commons-codec jar):

  Enrico was here start
  In order to pack the jars in a single jar
  I inserted this ant task
  for more details:
  <target name="-post-jar">
    <jar jarfile="dist/xml2BaseLibs-full-1.0.jar">
      <zipfileset src="${dist.jar}" excludes="META-INF/*" />
      <zipfileset src="lib/apache-commons/commons-codec-1.3.jar" excludes="META-INF/*" />
      <zipfileset src="lib/apache-commons/commons-beanutils.jar" excludes="META-INF/*" />
        <attribute name="Main-Class" value="org.xml2sqr.xml2BaseLibs.ver1_0.Main"/>
    <copy file="dist/xml2BaseLibs-full-1.0.jar" tofile="dist/xml2BaseLibs.jar" overwrite="true"/>
  Enrico was here end

With my surprise, the lib element of the included project (PRJ-B) seems not correctly referred inside the main project (PRJ-A): 
syntax highlight gives an error and no autocompletion of any kind (import, methods, properties...) is available on the apache-commons-codecs classes.
But I am even more surprised by the fact that I am able to compile and run from command line (not debug) the project (no compiler errors, neither runtime ones): it seems commons is there and works, using the direct call

java -jar "[someBaseFolders]/NetBeansProjects/PRJ-A/dist/PRJ-A.jar"

At the moment I'm making a workaround for this (I directly include the generated jar, eventually copying it in the PRJ-A, still using an ant task), in order to make the editor work, but I'd rather prefer the project inclusion.

thanks for any help
Comment 1 enrichicco 2011-02-11 15:02:52 UTC
Created attachment 105877 [details]
test case with PRJ-A and PRJ-B

a test case with the two projects.
Hope it (doesn't) works...
Comment 2 Dusan Balek 2011-02-16 14:39:29 UTC
Unfortunately, the NetBeans ant based projects does not support transitive dependencies. You have to manually add references to all of the dependent project libraries via e.g. Project Properties.

*** This bug has been marked as a duplicate of bug 47507 ***