Reading properties file from Maven POM file

前端 未结 3 1089
自闭症患者
自闭症患者 2020-12-01 07:26

I have Maven POM file with some configuration and in the section plugins, I have maven tomcat plugin with some configuration like this:

         


        
3条回答
  •  伪装坚强ぢ
    2020-12-01 08:08

    Complete working example available at: http://hg.defun.work/exp/file/tip/maven/properties

    Here essential part of pom.xml:

    
      
        org.codehaus.mojo
        properties-maven-plugin
        1.0-alpha-2
        
          
            initialize
            
              read-project-properties
            
          
        
        
          
            dev.properties
          
        
      
    
      
        org.apache.maven.plugins
        maven-antrun-plugin
        1.6
        
          
            compile
            
              run
            
            
              
                project.build.sourceEncoding is "${project.build.sourceEncoding}"
                foo is "${foo}"
                with-spaces is "${with-spaces}"
                existent.property is "${existent.property}"
                nonexistent.property is "${nonexistent.property}"
              
            
          
        
      
    
    

    As you can see properties-maven-plugin still at alpha stage, that is why I hate Maven as build tools...

提交回复
热议问题