Maven Package Compilation Error

后端 未结 12 1765
栀梦
栀梦 2020-12-05 07:39

i created a webapp project using maven in eclipse. when i run the command mvn package in command prompt it showing folowing error.

[ERROR] COMPILATION ERROR         


        
12条回答
  •  青春惊慌失措
    2020-12-05 08:08

    I'm using maven plugin for Eclipse (V3.3) and was struggling with this error for a while. I finally found the solution which is linked to stale java sources: it has nothing to do with JRE or JDK (I use JRE 1.7).

    I found on other forums that it is a known problem in maven-compiler-plugin (same result for V3.3 and 3.5.1).

    So, I just recompiled manually the stale source(s) and ran again the goal, this time without any problem.

    To figure out stale sources, run the goal with option -X (debug) and look for entries beginning with

    [DEBUG] Stale source detected:
    

    indicating a java class file (to be recompiled manually...).

    Hope this can be useful as the message given by maven compiler made me search in a wrong direction (play with JRE, JDK, JAVA-HOME, etc).

提交回复
热议问题