Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-25299

Maven Source Lookup changing source attachment to wrong artifact

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 4.30.x
    • 4.5.1.AM3
    • maven
    • None
    • Hide
      1. Create a new Maven project.
      2. Add dependency: groupId = com.google.inject, artifactId = guice, version = 4.1.0
      3. Wait for Eclipse to add the JAR to the classpath, and download sources/javadoc.
      4. Expand Maven Dependencies and drill into the Guice JAR. Open up the class com.google.inject.AbstractModule.
      5. Find the method bindListener(Matcher, ProvisionListener) at the bottom of the class.
      6. Hover over the call to bindListener() inside the method.
      7. Hold down CTRL and click "Open Implementation".
      8. Watch as Eclipse initially opens the correct source file, then goes over to "Source not found".

      If you then click "Change Attached Source...", you'll notice that the source location is now for some reason pointing to cglib 3.2.0. This may have something to do with the Guice JAR including relocated copies of cglib's classes.

      At this point, you can change the source to the correct location, and things will be fine until you close all of the source files you have open. Then if you repeat from step 4, the source attachment will get changed again.

      Show
      Create a new Maven project. Add dependency: groupId = com.google.inject, artifactId = guice, version = 4.1.0 Wait for Eclipse to add the JAR to the classpath, and download sources/javadoc. Expand Maven Dependencies and drill into the Guice JAR. Open up the class com.google.inject.AbstractModule. Find the method bindListener(Matcher, ProvisionListener) at the bottom of the class. Hover over the call to bindListener() inside the method. Hold down CTRL and click "Open Implementation". Watch as Eclipse initially opens the correct source file, then goes over to "Source not found". If you then click "Change Attached Source...", you'll notice that the source location is now for some reason pointing to cglib 3.2.0. This may have something to do with the Guice JAR including relocated copies of cglib's classes. At this point, you can change the source to the correct location, and things will be fine until you close all of the source files you have open. Then if you repeat from step 4, the source attachment will get changed again.
    • -

      Maven Source Lookup sometimes causes Eclipse to use an incorrect sources attachment. If Maven Source Lookup is disabled using Window -> Preferences, General -> Startup and Shutdown, the problem does not occur.

            Unassigned Unassigned
            rdicroce Richard DiCroce (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: