http://blog.csdn.net/typa01_kk/article/details/49185759

Maven Summary of project error resolution

notes : Sorting out mistakes , I don't like it for a small problem , take up space , So please Ctrl+F Check for yourself , Location problem , Willing to solve .

notes : Error resolution experience on the Internet , It's just that the author happened under certain conditions , Or it's right for you, not right for you , Don't blame , If there is no solution , Please consult others or be patient , You can record it and share it , We love to share , Let's start together !

problem 1:

-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.

solve 1:

 You can set up a windows os's environment variable M2_HOME Point to your maven The installation directory 
M2_HOME=D:\Apps\apache-maven-3.3.
And then in Window->Preference->Java->Installed JREs->Edit
stay Default VM arguments Set in
-Dmaven.multiModuleProjectDirectory=$M2_HOME
problem 2:
java.lang.ClassNotFoundException: org.springframework.web.util.IntrospectorCleanupListener /org.springframework.web.context.ContextLoaderListener
solve 2:

 Selected items -> Right click Properties-> choice Deployment Assemby-> choice Add-> Choose Java Build Path Entries->Next-> choice Maven Dependencies->Finish->Apply->OK

  

problem 3:
The import com.tsxs.common.tool.ValidateCodeImg cannot be resolved
solve 3:

Eclipse -> Project -> Clean...
Ok.

  

problem 4:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'shiroDBRealm' is defined
solve 4:

 <property name="realm" ref="shiroDBRealm" />
<bean id="shiroDbRealm" class="com.tsxs.security.ShiroDbRealmUser">
</bean>
To configure id and ref Inconsistent case of (ctrl+f Search is case insensitive ). Letter B/b.
problem 5:
java project transformation exchange maven project:
[ERROR] Plugin org.apache.maven.plugins:maven-jar-plugin:2.4 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:maven-jar-plugin:jar:2.4 in http://localhost:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
solve 5:

 stay Convert to Maven Project When the pom.xml Next :<version>0.0.-SNAPSHOT</version> To <version>0.0.</version> after maven clean install.  
problem 6:
September 13, 2015 1:20:48 In the morning org.apache.catalina.core.StandardContext listenerStart
serious : Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from file
[D:\developer\softwares\servers\apache-tomcat-8.0.24\webapps\weloveshare\WEB-INF\classes\applicationContext-mybatis.xml];
nested exception is com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 3 Bytes of UTF-8 The byte of the sequence 3 Invalid .
Caused by: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 3 Bytes of UTF-8 The byte of the sequence 3 Invalid .
error file
solve 6:

 Final solution :
1 Use software "010 Editor Is a new hexadecimal file editor " Check the file header for garbled code , Delete and save ok 了 .
2 because , I , Reorganized partitions ( Dual system ), But , I rebuilt a project , Copying code used to be ok 了 .
problem 7:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4 or Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin: 2.4..
solve 7:

 solve : Restart it console-nexus.bat Just fine , Or delete local maven The package corresponding to the warehouse ( Delete the root package involved )  
problem 8:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException
solve 8:

dependency Not in the dependencies Inside   
problem 9:
maven Add a new :dependency stay install When , Report errors nexus There is no corresponding jar package
solve 9:

 Mainly delete local maven Of repositories The corresponding position under the jar The path of , again install Just ok.
Or restart nexus Or it doesn't start nexus.
problem 10:
Java Project turn maven project Because there was no mistake Maven Dependencies route
solve 10:

 Right click Project :Maven->Disable Maven Nature
then , Turn again maven:
Configure->Convert to Maven Project. ok!
notes : Generally, there is no need to restart nexus The server , Unless the process port is occupied or the service is stopped , Or server shutdown or crash , Delete the local corresponding path file ,clean install Then solve !
 
 
 
problem 11:
Set up pom.xml after ,clean install Compile without error , Just can't load Maven Dependencies And download jar package
solve 11:
 because <dependency> stay <dependencies> in , but <dependencies> And in the <dependencyManagement> in , Delete the outermost <dependencyManagement> after ,clean install  Then solve ! Explain it differently , Remarks attachment !

  

problem 12:
If pom.xml in <dependency> Label error, draw a red line and report a red cross , error :Missing artifact mycoding.kaka:kaka:jar:0.0.1
stay Markers Error reported in :
Description Resource Path Location Type
Missing artifact mycoding.kaka:kaka:jar:0.0.1 pom.xml /zJavaDemo line 20 Maven Dependency Problem
This problem is solved , It's also suitable for third-party non dependence jar And local extension classes maven Unified management
solve 12:
1: If the right dependencies are provided for other technical support websites <dependency>, Then delete the local maven Of repositories The corresponding position under the jar And all the files , Again clean install Then solve !
2: Maven Custom upload third party package to 3rd party( Third party is not dependent on jar And local extension classes maven Unified management )
 
 
 
problem 13:
Description Resource Path Location Type
Project configuration is not up-to-date with pom.xml. Run Maven->Update Project or use Quick Fix. webproject line 1 Maven Configuration Problem
 
solve 13:

 Right click item  ——> Maven ——> Update Project ……, Open one (Update Maven Dependencies) The dialog , Then check the wrong item , Click on Ok  
problem 14:
Description Resource Path Location Type
Java compiler level does not match the version of the installed Java project facet. webproject Unknown Faceted Project Problem (Java Version Mismatch)
 
solve 14:

workspace The next part of this project is .setting Next org.eclipse.jdt.core.prefs file ( Modifications and jdk Consistent version ):
eclipse.preferences.version=
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8
problem 15:
[ERROR] D:\DeveloperX\Code\Java\src\main\java\com\tsxs\module\utils\NetworkUtil.java:[3,25] error : Package javax.servlet.http non-existent
[ERROR] D:\DeveloperX\Code\Java\src\main\java\com\tsxs\module\utils\NetworkUtil.java:[14,41] error : No symbols found
solve 15:

 Item right click  --> properties --> Java Build Path Of libraries Guarantee only :JRE System Library[jdk1.8.0.66] and  Maven Dependencies
notes : If there is Apache Tomcat v8.0[Apache Tomcat v8.0] be ,Remove Delete it , stay pom.xml Add the following dependency to let maven Unified management !
notes : The version depends on itself jdk and tomcat edition
<!-- servlet/jsp -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
</dependency>

  Configuration that needs attention :

problem 15 Expand : Page none controller Dealing with jumps also requires 15 solve !
 <!-- Container default DefaultServletHandler Handle All static content and none RequestMapping To deal with the URL -->
 <mvc:default-servlet-handler />
 <!-- No need to define Controller Of url<->view Direct mapping -->
 <mvc:view-controller path="/" view-name="redirect:/index.html" />
 
 
 
problem 16:Description Resource Path Location Type
One or more constraints have not been satisfied. webproject line 1 Maven Java EE Configuration Problem
Tips 16: View the jdk and compiler and eclipse working space workspace The version number of each file in the next project

Maven More related articles on project error resolution summary

  1. eclipse maven Project error

    eclipse maven Project error :Failure to transfer org.codehaus.plexus:plexus-interpolation:jar:1.15 from http:// ...

  2. maven Common mistakes and solutions

    1. The most important point , Use domestic image , such as oschina.net Mirror image : search jar recommend :http://maven.outofmemory.cn/, Extremely fast . 2. error :Could not res ...

  3. stay maven Solve the third party in the project jar The problem of package dependency

    stay maven In the project , For those in maven A third party that doesn't exist in the warehouse jar, Dependency resolution usually has the following solutions : Method 1: Direct will jar Copy the package to the specified directory of the project , And then in pom The dependency type specified in the file is system, Such as : < ...

  4. newly build maven Project error handling

    1. If new maven Project saving maven dependencies, In the engineering with problems .classpath At the end of   add <classpathentry kind="con"  ...

  5. IDEA from Github in Clone Maven project , Solve tree directory and Jar The problem of package dependency

    A problem that many people will encounter in development , When we use IDEA from Github It was found that Maven After the project (Java), Found that neither can run , It can't compile , The tree on the left is weird , Now let's talk about how to solve this problem . IDEA from git ...

  6. IDEA Created in maven Post project resolution main The problem of incomplete directory under the folder

    IDEA establish maven-archetype-webapp When the project is , After the creation, it was found in main No under folder java,resource Wait for the source folder . resolvent : 1. choice File->Project S ...

  7. git Error resolution -- Summary

    1. today When I   perform   Git add  somefile When , appear as follows error : If no other git process is currently running, this prob ...

  8. maven Common error resolution

    1. maven When packaging and compiling, the background always outputs warning information [WARNING] File encoding has not been set, using platform encoding GBK, i.e. ...

  9. Win7:“ The project could not be found ” The solution to mistakes

    1. Copy and paste the following code into a new txt Notepad document , And save as del.bat file ( Or your favorite name ), Note that the extension is batch file bat. DEL /F /A /Q \\?\%1RD /S /Q \\?\%1 ...

Random recommendation

  1. stay Salesforce It's announced to the public from China Service To create Lead, And use Asp.Net To call this Service

    1): stay Salesforce How to configure , Publish this Service, Please see the link below : http://www.shellblack.com/marketing/web-to-lead/ 2): How to be in Asp. ...

  2. solve rand() Pseudo random number

    utilize time Change the seeds example : #include <stdlib.h> #include <stdio.h> #include <time.h>// Use the current clock as the seed ...

  3. asp.net Data binding -- Time format

    <asp:TemplateField HeaderText=" date " SortExpression="Date">                & ...

  4. Intent Start a new page

    One ,Intent( Purpose ) The classification of Explicit Intent One of the constructor overloads : Intent intent = new Intent(FirstActivity.this,SecondActivity.cl ...

  5. Hadoop.2.x_ Source code compilation

    One . Basic environment construction 1. Get ready hadoop-2.5.0-src.tar.gz apache-maven-3.0.5-bin.tar.gz jdk-7u67-linux-x64.tar.gz proto ...

  6. Big talk JS Object oriented extensions Game theory between object oriented and process oriented (OO Vs The process )------( A simple example of meditation )

    One , General summary 1, On the author I learn from Java Programming starts to touch OOP( object-oriented programming ), Just beginning to use Java I feel very awkward when I write the program ( Object oriented programming because of the introduction of classes . object . Examples and other concepts , It's very close to human's recognition of all things in the world ...

  7. object-oriented -- Class library 、 entrust 、is and as Operator 、 Generic set

    Class library : It's just a bunch of class files , Just can't see the source code of these classes , Confidentiality is good. . advantage : Confidentiality is good. shortcoming : If it doesn't work , Users can't change it themselves . Most of them are dll file . Usage method : Right click reference , Add reference , Browse , Select to phase ...

  8. inputstream and outputstream Read and write data template code

    // Read and write data template code byte buffer[] = new byte[1024]; int len=0; while((len=in.read(buffer))>0){ out.write(b ...

  9. windows Fancy dress system

    Catalog One . Prepare before installing the system Get ready U disc Prepare a software to make a startup disk Prepare the system image Two . Next, make a startup disk ( By micro PE For example ) 3、 ... and . Plug in u disc , transfer BIOS(BIOS The basic input-output system ) Four . Get into PE 5、 ... and . Start installation ...

  10. ENVI In the use of polygon The mask modifies the class to the specified class

    overlay——classification—— Develop classified images edit——polygon delete from class( Select this mask mode ) edit——set delete class va ...