標籤:
一、 解決關聯第三方jar源碼
在pom檔案中加入:
Xml代碼
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <version>2.9</version>
- <configuration>
- <additionalProjectnatures>
- <projectnature>org.eclipse.jdt.core.javanature</projectnature>
- <projectnature>org.eclipse.m2e.core.maven2Nature</projectnature>
- <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
- </additionalProjectnatures>
- <additionalBuildcommands>
- <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
- <buildcommand>org.eclipse.m2e.core.maven2Builder</buildcommand>
- <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
- </additionalBuildcommands>
- </configuration>
- </plugin>
- </plugins>
- </build>
在項目下執行:
Java代碼
- mvn dependency:sources
然後再執行:
Java代碼
- mvn eclipse:eclipse
基本上第三方jar就關聯上源碼了。。
二、關聯項目的源碼
Debug As --> Debug Configuration -->在右側面板選擇Source -->Add -->Project
下面就選擇自己的項目,添加進來,一路Ok,Apply 就行了
注意:關聯了項目源碼之後,進行Debug時,Eclipse可能會彈出如的錯誤提示,直接點OK忽略即可。
----------------------------------------------------------
轉自:關於maven tomcat plugin 調試源碼的解決方案
[轉] 關於maven tomcat plugin 調試源碼的解決方案