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 198208 - NetBeans 7 Does Not Find All Maven Dependency Libraries
Summary: NetBeans 7 Does Not Find All Maven Dependency Libraries
Status: RESOLVED INCOMPLETE
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0.1
Hardware: All All
: P2 normal with 2 votes (vote)
Assignee: Milos Kleint
URL: http://forums.netbeans.org/viewtopic....
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-29 15:04 UTC by deckerego
Modified: 2013-05-16 07:52 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
A POM that exhibits the described issues. (13.40 KB, text/xml)
2011-04-29 15:04 UTC, deckerego
Details
Better test case (uses a site which gives proper 404s) (424 bytes, application/octet-stream)
2011-06-22 21:35 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description deckerego 2011-04-29 15:04:25 UTC
Created attachment 108019 [details]
A POM that exhibits the described issues.

NetBeans 6.9.1 correctly interrogates my pom.xml and loads 85 dependent jars and their requisite dependencies as well. NetBeans 7 only loads 80, several of which are fairly shallow dependencies (like the bean loader for spring-core). Things work if you explicitly define them in the POM, but otherwise libraries like common-management-1.0.jar (a direct dependency of camel-core) do not appear.

I'm running 6.9.1 side-by-side with NetBeans 7, and 6.9.1 loads the classpath correctly.
Comment 1 summersb 2011-05-02 14:43:01 UTC
After I refreshed the index from the options screen, maven tab, I was able to resolve the dependencies that it could not find before.
Comment 2 deckerego 2011-05-02 18:17:18 UTC
Removed any unnecessary repositories and re-indexed the remaining Maven repos twice, just to be safe. Performed a mvn clean & build on the project, then re-loaded the project within NB7. No luck - still missing dependencies. Rebuit the parent as well as the individual child modules, but that didn't appear to make a difference. Performed a "Build with Dependencies," but no luck. Closed the project, re-opened it... still missing deps. Re-loaded the IDE, still missing deps.

Seems like the re-indexing didn't help out with my scenario. Does anything else modify NB7's dependency resolution?
Comment 3 deckerego 2011-05-02 18:39:35 UTC
I subsequently went whole-hog and deleted ~/.netbeans/7.0/, starting from scratch. Made sure I had a blank slate. Same issues. Re-indexed again after deleting the user directory. Issues remained.

_Then_ I switched to Maven 2.2.1 and things started working again! Didn't have to re-index, either.

So it seems this has to do with either Maven 3 or the bundled implementation.
Comment 4 Jesse Glick 2011-05-05 20:56:16 UTC
I was not able to reproduce in a dev build. commons-management-1.0.jar (org.fusesource.commonman) appeared under Dependencies after I built and opened your project. Double checked in 7.0 FCS with a fresh user dir; same result.

(To make the attachment buildable, I had to comment out the <parent> declaration, replacing with <version>3.5</version>; it still of course failed during the make-assembly goal since you did not attach a complete project, just a POM.)

Also compared the Dependencies listing to Libraries in 6.9 and did not notice any difference.

The Maven indices should not be involved in dependency resolution, and the NB user dir is unlikely to matter either. Something broken in your local repository might be responsible. Or the parent project might be affecting how this project is loaded (but I cannot see that so I do not know).
Comment 5 deckerego 2011-05-05 21:00:13 UTC
Might be fixed in dev build then. The workaround for me was to use Maven 2.2, as the built-in Maven 3 implementation always missed the same dependencies while my Maven 2.2 installation always fetched them. I don't necessarily think the index or the user dir was the fix, but instead the difference between the Maven 2 libraries and the Maven 3 libraries.
Comment 6 Jesse Glick 2011-05-05 22:18:58 UTC
(In reply to comment #5)
> The workaround for me was to use Maven 2.2,
> as the built-in Maven 3 implementation always missed the same dependencies
> while my Maven 2.2 installation always fetched them.

Maven builds in NB 7.0 run an unmodified Maven 3.0.3 binary, so it is possible you are simply running into an M3 upgrade issue. https://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html has a list of things you should look over. Generally speaking, M3 is just stricter about practices that were discouraged under M2 as well.
Comment 7 Jesse Glick 2011-06-22 21:35:09 UTC
Created attachment 109066 [details]
Better test case (uses a site which gives proper 404s)
Comment 8 Jesse Glick 2011-06-22 21:36:08 UTC
Comment on attachment 109066 [details]
Better test case (uses a site which gives proper 404s)

Oops, wrong issue, please ignore.
Comment 9 mzav 2011-10-11 07:57:34 UTC
I use NetBeans 7.0.1 with Maven 2.2.1
NetBeans 6.9 works perfect, but 7.0...

I have a complex POM and jars of some dependencies are not displayed in "Dependencies" branch of the "Projects" window.
Probably as a result inline syntax analizer gives me a lot of syntax errors like "package xxx does not exist" - despite compilation works without any problem.
Just due to this wrong syntax analizing still can't migrate to 7.0

I have problems with the following dependencies:
    <dependency>
      <groupId>com.scc.slm</groupId>
      <artifactId>publicInterface</artifactId>
      <version>${project.version}</version>
    </dependency>
- this is my own sub-project. It is not displayed in the "Dependencies" at all.

    <dependency>
      <groupId>com.sun</groupId>
      <artifactId>tools</artifactId>
      <scope>system</scope>
      <version>1.6</version>
      <systemPath>${java.home}/../lib/tools.jar</systemPath>
    </dependency>
it is displayed as "tools-1.6.jar" (old NetBeans displays it as "tools.jar"), and displays a warning: "Dependency not loaded yet. Build project to correct errors."
Comment 10 Jesse Glick 2011-10-12 20:10:33 UTC
(In reply to comment #9)
> this is my own sub-project

I cannot evaluate without a complete, self-contained test case.

> it is displayed as "tools-1.6.jar" (old NetBeans displays it as "tools.jar"),
> and displays a warning: "Dependency not loaded yet. Build project to correct
> errors."

Working fine for me in a 7.1 development build. (I filed bug #203613 but it is something else.) If you continue to have issues with 7.1, please file fresh bugs with complete steps to reproduce from scratch.
Comment 11 mzav 2011-10-13 08:37:48 UTC
It really works in 7.1 beta !
7.0 has the problem only - since RC1.
Comment 12 hansgeorg.schwibbe 2013-05-07 08:00:58 UTC
Same issue for NetBeans 7.3.

We are using Eclipse in our project. I tried to validate NetBeans 7.3 as an alternative to Eclipse. But when I build our maven project with NetBeans 7.3, there is always one dependency NetBeans cannot resolve.

I will take a look on the next NetBeans release. But for now im back using Eclipse again, sorry.
Comment 13 hansgeorg.schwibbe 2013-05-07 08:02:05 UTC
Same issue for NetBeans 7.3.

We are using Eclipse in our project. I tried to validate NetBeans 7.3 as an alternative to Eclipse. But when I build our maven project with NetBeans 7.3, there is always one dependency NetBeans cannot resolve.

I will take a look on the next NetBeans release. But for now im back using Eclipse again, sorry.
Comment 14 Jesse Glick 2013-05-07 14:08:25 UTC
hansgeorg.schwibbe: please do not move the Version field forward. And bugs like this can only be addressed if you can provide a test case for developers to reproduce.
Comment 15 Milos Kleint 2013-05-16 07:10:17 UTC
hansgeorg.schwibbe: please provide a testcase project and reopen the issue thanks. Without it we cannot evaluate your problem.  Are you using maven 3.x to build your projects or 2.x?
Comment 16 hansgeorg.schwibbe 2013-05-16 07:47:49 UTC
I am using Maven 3.0.4 with Sonatype Nexus 1.9.2.4 as repository. I cannot provide a sample project because it is not open source.
Comment 17 Milos Kleint 2013-05-16 07:52:45 UTC
(In reply to comment #16)
> I am using Maven 3.0.4 with Sonatype Nexus 1.9.2.4 as repository. I cannot
> provide a sample project because it is not open source.

ok, and can you provide some information about the dependency? is it transitive or direct? are the coordinates from a public repository? is it a system dependency? is it managed? etc.. can you paste the definition of the dependency? are some system property expressions used in the definition?