Search code examples
mavenjava-service-wrapper

Changing java service wrapper conf file property inside a pom


I'm using java service wrapper in a project and want to change wrapper.logfile.maxsize property of the wrapper.conf file.The thing is that it would be better if I can change it inside maven pom.xml file. So can anyone please tell me whether this is possible and if so how to do it ?

Thanx...


Solution

  • Use Maven Resource Plugin's Filtering feature. Let's say the line that needs to be configured by Maven looks like

    wrapper.logfile.maxsize=500
    

    Replace it with:

    wrapper.logfile.maxsize=${wrapper.logfile.maxsize}
    

    add filtering in the project/build/resources/resource/ section with:

    <filtering>true</filtering>
    

    and populate the right value from command line:

    mvn resources:resources -Dwrapper.logfile.maxsize="500"