Eclipse not picking up Maven attached source on debug

后端 未结 8 482
礼貌的吻别
礼貌的吻别 2021-01-03 21:24

I\'ve downloaded the source for all the Maven JARs in my buildpath using Maven->Download Sources and mvn eclipse:eclipse -DdownloadSources=true, which worked! W

相关标签:
8条回答
  • 2021-01-03 21:42

    Window->Preferences->JBoss Tools->Source Lookup

    make sure you have check "Automatically add the JBoss Maven source container to all JBoss As launch configurations". and under "Automatically configure the Java Source Attachment", choose "Always".

    this helps myself out of the problem.

    0 讨论(0)
  • 2021-01-03 21:45

    I think I fixed this for myself by updating my Eclipse m2e. I think I had version ~1.2, and then updated to latest [as of writing] 1.6.2.

    The Eclipse Bug comments helped me figure this out.

    Now I can debug into my gquery-dnd-bundle-1.0.6!

    0 讨论(0)
  • 2021-01-03 21:46

    The "target" maven project should emit it's source code before the "client" projects can have access to the source code. I solved the issue by using the maven-source-pluging in the "target" project: https://maven.apache.org/plugins/maven-source-plugin/index.html

    Just use the following snippet in the pom.xml file of the target project, make a release, and use the release version into the pom.xml file of the client project. Then eclipse can automatically let you "jump" to the target project seamlesly:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${version.maven-source-plugin}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                            <goal>test-jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
    
    0 讨论(0)
  • 2021-01-03 21:50

    Use External Maven instead of default Embedded in Debug Configurations dialogue.

    Please see example screenshot below (menu Run -> Debug Configurations...):

    Configure external Maven

    Tested environment:

    • Eclipse IDE for Java Developers: Oxygen.1a Release (4.7.1a), 64-bit (from spring.io)
    • Oracle JDK jdk1.8.0_144, 64-bit
    • Maven: 3.5.2
    • OS: Windows 10 Enterprise N, 64-bit
    • Test goal hpi:run (sample Jenkins plugin)
    0 讨论(0)
  • 2021-01-03 21:53

    I found this com.ifedorenko.m2e.sourcelookup plugin. The link was provided in "Java Debugging: Source not found".

    Go to Help > Install New Software .. and use

    http://ifedorenko.github.com/m2e-extras/

    to search for the links. After installing this plugin I was finally able to debug the source code of dependencies.

    0 讨论(0)
  • 2021-01-03 21:54
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${version.maven-source-plugin}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                            <goal>test-jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
    
    0 讨论(0)
提交回复
热议问题