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 129056 - classpath broken while adding artifacts new to the local repository
Summary: classpath broken while adding artifacts new to the local repository
Status: RESOLVED DUPLICATE of bug 128326
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-03 21:38 UTC by kawazu428
Modified: 2008-06-26 13:00 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kawazu428 2008-03-03 21:38:49 UTC
It seems that NB mvn2 tooling suffers from a strange issue requiring an IDE restart and/or closing and re-opening the
project this artifact has been added to.

To reproduce this, please

- have a look at [1] and pick a version of Spring framework not yet around in your local .m2/repository,
- create a new maven2 project and add this version as a dependency using "Add library" or manually adding it to pom.xml
(the library by then should appear in "Libraries" in the project, marked as red as it is not around),
- chose "download all libraries" (the library by now will look like it is actually around locally, but in front of it,
looking at "Libraries", there ain't the arrow to browse its contents).
- open the "App.java" created by the project wizard and enter these statements:

        ApplicationContext context = new ClassPathXmlApplicationContext(
                new String[]{"appctx.xml"});  

 ... the *Context classes will be highlighted red.

By now, things are like this:
- Obviously, the dependency has been added to the project, according to "Libraries", same as its transitional dependencies.
- Using "Fix imports" on "App.java", nevertheless, doesn't work (doesn't import anything).
- Likewise, trying to clean and build the project ends up ih these classes missing.

Closing and re-opening the project makes the relevant .jar in "Libraries" browseable, and by then also "Fix imports" and
building the artifact does work again.

This reproducibly happens for any jar added to a maven2 project for the first time (i.o.w. fetched from a remote
repository before being used).


[1] http://repo1.maven.org/maven2/org/springframework/spring/
Comment 1 Milos Kleint 2008-03-04 14:52:08 UTC
duplicate of #128326

*** This issue has been marked as a duplicate of 128326 ***