Tag Archives: java

maven 编译 NoSuchMethodError 错误解决方法

今天update了下项目,maven compile 时报了个错。
错误如下:

           
                org.apache.maven.plugins
                maven-compiler-plugin
                3.1
                
                    
                        org.codehaus.plexus
                        plexus-compiler-javac
                        2.2
                    
                
                
                    1.6
                    1.6
                    utf-8
                    true
                
            

当上面的

                    
                        org.codehaus.plexus
                        plexus-compiler-javac
                        2.2
                    

中的version版本太低,如1.8的时候会报一个错误:
java.lang.NoSuchMethodError: org.codehaus.plexus.compiler.CompilerError: method (Ljava/lang/String;ZIIIILjava/lang/String;)V not found
改成2.2就好了。
reference:
http://chaoslawful.iteye.com/blog/1829357