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 189084 - Incorrect artifact resolution: inherited indirect vs. explicit provided
Summary: Incorrect artifact resolution: inherited indirect vs. explicit provided
Status: RESOLVED DUPLICATE of bug 188871
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jesse Glick
URL: https://guest:@stapler.dev.java.net/s...
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-30 15:30 UTC by Jesse Glick
Modified: 2010-10-05 22:03 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 Jesse Glick 2010-07-30 15:30:06 UTC
The source file indicated in the URL shows error badges when opened in the IDE (build tree then open parent w/ required projects), but compiles cleanly with Maven 2.2.1 or 3.0-beta-1. (Neighboring MockRequest is similar.) The project POM says

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.3</version>
      <scope>provided</scope>
    </dependency>

and the parent POM has

    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty</artifactId>
      <version>6.1.11</version>
      <scope>test</scope>
    </dependency>

which indirectly includes org.mortbay.jetty:servlet-api-2.5:6.1.11:jar. Maven seems to give precedence to the 2.3 Servlet API in provided scope, thus permitting MockServletContext to implement ServletContext. But NB seems to give precedence to the 2.5 API inherited from Jetty, so the NB editor complains that getContextPath() is unimplemented.

Workaround is to add

      <exclusions>
        <exclusion>
          <artifactId>servlet-api-2.5</artifactId>
          <groupId>org.mortbay.jetty</groupId>
        </exclusion>
      </exclusions>

to the parent POM and restart the IDE after deleting $userdir/var/cache/index.
Comment 1 Jesse Glick 2010-10-05 22:03:45 UTC
Seems fixed by M3 embedder.

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