
是的,您可以在每个配置文件中添加的配置,
maven-war-plugin并将每个配置配置为指向不同的
web.xml。
<profiles> <profile> <id>profile1</id> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <webXml>/path/to/webXml1</webXml> </configuration> </plugin> ...
作为不必
maven-war-plugin在每个概要文件中指定配置的替代方法,可以在POM的主要部分中提供默认配置,然后仅对特定概要文件覆盖它。
或更简单地说,在
<build><plugins>您的POM 主体中,使用属性来引用
webXml属性,然后在不同的配置文件中更改其值
<properties> <webXmlPath>path/to/default/webXml</webXmlPath></properties><profiles> <profile> <id>profile1</id> <properties> <webXmlPath>path/to/custom/webXml</webXmlPath> </properties> </profile></profiles><build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <webXml>${webXmlPath}</webXml> </configuration> </plugin> ...欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)