Override Maven Plugin Parameters -
this question has answer here:
i have maven plugin , configured in pom file
<build> <plugins> <plugin> <groupid>com.example</groupid> <artifactid>example-maven-plugin</artifactid> <configuration> <scriptspath>scripts</scriptspath> </configuration> </plugin> </plugins> </build> now want override scriptspath from command line run
mvn -x example-maven-plugin:goal -dscriptspath=scripts1 i can see value of scriptspath still scripts , not scripts1. configuration parameter overriden command line ?
unfortunately, there no general way override maven plugin configuration using properties. if plugin documentation not explicitly allow use property set configuration value can use following pattern:
<properties> <scripts.path>scripts</scripts.path> </properties> <build> <plugins> <plugin> <groupid>com.example</groupid> <artifactid>example-maven-plugin</artifactid> <configuration> <scriptspath>${scripts.path}</scriptspath> </configuration> </plugin> </plugins> </build> and execute maven as
mvn -x example-maven-plugin:goal -dscripts.path=scripts1
Comments
Post a Comment