How can I force maven to package my project against 1.5?

前端 未结 2 1550
温柔的废话
温柔的废话 2020-12-17 20:02

I am trying to compile a maven project, the source code uses Generics and other featuers of Java 1.5, thus causing my build to fail

In my POM.xml I have

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-17 20:55

    You configured the assembly-plugin with some information about source/target but to configure the compiling you need to configure the compiler-plugin in the correct way.

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

    Update: This should be combined with maven-enforcer-plugin to force really using of JDK 1.5 instead of only using source/target option of the javac.

提交回复
热议问题