1 set JPDA_ADDRESS=7070
2 exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@"
后在eclipse新建debug配置,这样就可以远程调试solr了,要注意服务器端Solr.war包的代码与eclipse的Solr代码一致。
二.Eclipse 的Solr环境搭建
2.1 Solr的编译
进入solr的目录,运行ant:
1 192:solr-4.8.0 rcf$ ant
2 Buildfile: /Users/rcf/workspace/java/solr/solr-4.8.0/build.xml
3
4 -projecthelp:
5 [-] Buildfile: /Users/rcf/workspace/java/solr/solr-4.8.0/build.xml
6
7 Main targets:
8
9 check-svn-working-copy Checks the status of the SVN working copy
10 clean Clean Lucene and Solr build dirs
11 clean-eclipse Removes all Eclipse configuration files
12 clean-idea Removes all IntelliJ IDEA configuration files
13 clean-jars Remove all JAR files from lib folders in the checkout
14 clean-maven-build Clean up Maven POMs in working copy
15 clean-netbeans Removes all Netbeans configuration files
16 compile Compile Lucene and Solr
17 compile-test Compile Lucene and Solr tests and test-frameworks
18 documentation Generate Lucene and Solr Documentation
19 documentation-lint Validates the generated documentation (HTML errors, broken links,...)
20 eclipse Setup Eclipse configuration
21 generate-maven-artifacts Generate Maven Artifacts for Lucene and Solr
22 get-maven-poms Copy Maven POMs from dev-tools/maven/ to maven-build/
23 idea Setup IntelliJ IDEA configuration
24 ivy-bootstrap Download and install Ivy in the users ant lib dir
25 jar Build Lucene and Solr Jar files
26 jar-checksums Recompute SHA1 checksums for all JAR files.
27 jar-src Build Lucene and Solr Source Jar files
28 netbeans Setup Netbeans configuration
29 nightly-smoke Builds an unsigned release and smoke tests it
30 pitest Run PITest on both Lucene and Solr
31 precommit Run basic checks before committing
32 rat-sources Runs rat across all sources and tests
33 regenerate Runs all code regenerators
34 remove-maven-artifacts Removes all Lucene/Solr Maven artifacts from the local repository
35 resolve Resolves all dependencies
36 run-clover Runs all tests to measure coverage and generates report (pass "ANT_OPTS=-Xmx1536M" as environment)
37 run-maven-build Runs the Maven build using automatically generated POMs
38 test Test both Lucene and Solr
39 test-help Test runner help
40 test-with-heapdumps Runs tests with heap dumps on OOM enabled (if VM supports this)
41 validate Validate dependencies, licenses, etc.
42 validate-maven-dependencies Validates maven dependencies, licenses, etc.
43 Default target: -projecthelp
44
45 BUILD SUCCESSFUL
46 Total time: 0 seconds
运行 ant eclipse就可以对solr源码进行编译成eclipse工程。在编译ant eclipse时候可能会失败,这是可以运行 ant ivy-bootstrap