Property autocapitalization in maven

前端 未结 2 1616
萌比男神i
萌比男神i 2021-01-13 20:47

I have a maven project that requires a property to be set at the command line(-Dmy.property=val). What I need to do is to convert that string into all caps since that proper

2条回答
  •  感动是毒
    2021-01-13 21:27

    The groovy plugin could be used. The following configures it to run at the beginning of the Maven build process:

            
                org.codehaus.groovy.maven
                gmaven-plugin
                1.0
                
                    
                        initialize
                        
                            execute
                      
                       
                          
                          import org.apache.commons.lang.StringUtils
    
                          project.properties["my.property"] = StringUtils.upperCase(project.properties["my.property"]) 
                         
                     
                 
              
         
    

提交回复
热议问题