maven: (use -source 5 or higher to enable static import declarations)

后端 未结 1 1762
失恋的感觉
失恋的感觉 2021-01-01 10:45

How can I use source 5? I tried

mvn -source 5 test

but it didn\'t work :-)

When I compile the file by javac, everything works.

1条回答
  •  暖寄归人
    2021-01-01 11:19

    You need to configure the maven-compiler-plugin:

    
      ...
      
        
          
            org.apache.maven.plugins
            maven-compiler-plugin
            2.3.2
            
              1.5
              1.5
            
          
          ...
        
        ...
      
    
    

    EDIT: Changed example to use latest version of the plugin.

    0 讨论(0)
提交回复
热议问题