The MAVEN project encounters this type of problem for two reasons, the dependency of the class is not loaded, the compiler itself is set up, and the problem is cached.
Solve the first Category: 1, check the project Pom file, whether the necessary dependence are written clearly;
2, whether to use their own private library,<repositories>
<repository>
<id>release</id>
<name>private repository</name>
<url>http://xxxxxx</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>release</id>
<name>PrivateRepository</name>
<url>http://xxxxxxx</url>
</pluginRepository>
</pluginRepositories>
The pom file has this is the use of its own private library, the library's username password is not written clearly, generally in the MAVEN program directory settings.xml file set, under the <servers> tab settings, similar to this:
<servers>
<server>
<id>nexus</id>
<username>admin</username>
<password>aaaaaaaaaa</password>
</server>
<servers>
3, rely on adding correct, check the local class has not downloaded down, is generally looking for "C:\Users\Administrator\.m2\repository" this path has no corresponding jar package, if not, in the compiler open "Maven Projects "label, first clean, in the execution of install, this is the same as on the command line execution is the same effect.
If you do have this package, it should be the second type of problem.
Solve the second category:
1, File-project Structure-project SDK, to see if the SDK is selected, re-select a local installation of their own JDK.
2, the compiler in the MAVEN has not been set to succeed, File-settings-Search Maven,maven home directory, set to install the MAVEN path
3, if the error is not found, try the right maven Projects-report, refresh the style of the button, clear the compiler's cache is good