Building same project in Maven with different artifactid (based on JDK used)

后端 未结 5 681
悲哀的现实
悲哀的现实 2020-12-01 12:05

I have a scenario wherein my project needs to be compiled in different JDKs and the resulting artifact name should be different based on the JDK used. For example if the pro

5条回答
  •  情深已故
    2020-12-01 12:51

    Use Maven Profiles. Add this section inside the project tag of your pom.xml:

    
      
        
          1.4
        
        
           ${project.artifactId}-${project.version}-JDK1.4
        
      
      
        
          1.5
        
        
           ${project.artifactId}-${project.version}-JDK1.5
        
      
    
    

    See this to know more about profiles.

提交回复
热议问题