Check if library will work on a specific verion of Java

后端 未结 2 642
说谎
说谎 2021-01-13 22:15

What approach can be taken to verify that a library is compatible on a specific version of Java?

Example: Library X was compiled on Java 1.7, therefor it might not w

2条回答
  •  醉梦人生
    2021-01-13 22:24

    The best is to check the byte code via an enforcer rule which can be applied to your build by using the maven-enforcer-plugin...

    
      [...]
      
        
          
            org.apache.maven.plugins
            maven-enforcer-plugin
            1.4.1
            
              
                enforce-bytecode-version
                
                  enforce
                
                
                  
                    
                      1.7
                    
                  
                  true
                
              
            
            
              
                org.codehaus.mojo
                extra-enforcer-rules
                1.0-beta-4
              
            
          
        
      
      [...]
    
    

提交回复
热议问题