Today encountered a strange problem, the same test code, the local execution of no problem, but to the test machine execution, will prompt "No symbol found", the compile-time classpath is not found. Troubleshooting Half-day, found to be maven-surefire-plugin plug-in forkmode problem, I wrote in the Pom file is <forkMode>always</forkMode>. Take this out of the good, according to reason, not because of this cause the class path to find the problem Ah, search the use of the following Forkmode, as follows:
When Maven runs a test case, it executes the use case by calling MAVEN's surefire plug-in and fork a child process. The Forkmode property indicates whether you want to create a process for each test, or if all tests are completed in the same process.
Forkmode can be set to a value of "never", "once", "Always" and "pertest".
Pretest: Each test creates a new process, and creating a new JVM for each test is the most thorough method of individual testing, but is also the slowest, not suitable for continuous regression on Hudson.
Once: All tests are performed in one process. Once is the default setting and it is recommended to use the default setting for continuous regression on Hudson.
Always: Run scripts in parallel in a process, Junit4.7 or later, Surefire version to provide this feature at more than 2.6, where ThreadCount: Specifies the number of threads that can be allocated when executing. Valid only with the parameter parallel. Default: 5.
Attached to maven common plugins: http://maven.apache.org/plugins/index.html