使用idea 调试solr源代码

1,下载solr源代码,选择须要的版本,解压后此目录后文将称为SOLR-HOME
java

2,在SOLR-HOME,下执行ant ideaapache

在import idea时一直选择next便可浏览器

3,SOLR-HOME/solr下执行ant example命令socket

在此过程当中,我碰到了以下错误maven

impossible to acquire lock for org.apache.ant#ant;1.8.2ide

纠结了很久,终于知道怎么改了,出现这个错误的缘由是在maven仓库中ant1.8.2的超连接报404,修改方法以下,ui

由于solr是由ivy管理依赖,ant天然而然就在其中,咱们须要更改ant的版本,ivy-settings.xml位于SOLR_HOME/luceneidea

而后再执行ant example命令spa

4,见证奇迹的时候到了:debug

在SOLR-HOME/solr/example/执行

java
-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8984
-jar start.jar
6,配置idea的debug模式:

Run > Edit Configurations,点击加号按钮,选择Remote,配置端口号为8984,因为是本地模式选择localhost

7,而后run->debug->选择6中添加的名称,debug执行

结束,在浏览器中输入localhost:8983便可

相关文章
相关标签/搜索