The error itself:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project photohost: Compilation failure [ERROR] ...modul/file/FileUpload.java:[18,35] static interface methods are not supported in -source 1.5 [ERROR] (use -source 8 or higher to enable static interface methods) [ERROR] -> [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/MojoFailureException 

Link to this:

 public interface FileUpload { static String generateFileName **[小小蝎袥袗袝孝鞋小携 袧袗 协孝袨 袦袝小孝袨]**(){ ***....*** return fileName; } } 

    1 answer 1

    Static methods in interfaces are introduced only in Java 8. You compile with the standard of the earlier version.

    Errors need to be read - this is useful.

     static interface methods are not supported in -source 1.5 (use -source 8 or higher to enable static interface methods) 

    Install and use the latest JDK. In the compiler plugin version is indicated as follows:

     <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> 
    • Strange. I put only 1.8 everywhere but it worked only when writing to pom - Loligan
    • I am poorly worded. The point is not what version you installed, but in the source parameter. The Java compiler can be told to use an earlier standard . By default, maven-compiler-plugin does not know what version of JDK you have installed, therefore it uses source = 1.5 . I don鈥檛 know how in IDEA, for example, but Eclipse itself determines the project鈥檚 Maven JDK version using the source parameter. - enzo