在父pom

时间:2015-08-26 12:28:05

标签: maven web-applications

我有一个定义maven-war-plugin的父pom。

<plugin> 
 <groupId>org.apache.maven.plugins</groupId> 
 <artifactId>maven-war-plugin</artifactId> 
 <version>2.6</version> 
 <configuration> 
   <failOnMissingWebXml>false</failOnMissingWebXml> 
   <warName>${warname}</warName>
 </configuration> 
</plugin> 

在孩子pom中我宣布财产${warname}。当我尝试使用Eclipse&#39; Run as server&#39;来部署子Web模块时选项warname属性未解析。如果可以进行这种配置,请告诉我。

1 个答案:

答案 0 :(得分:2)

你做不到。您必须在parent-pom中设置属性并在子模块中使用它。这些属性只能从父母到孩子,而不是相反。