2011-09-04 37 views
1

我试图将Ant项目转换为Maven。现有的构建在src/main/webapp/WEB-INF/components.xml中使用Ant样式属性,该属性是Seam文件。Maven:过滤目标目录中的seam components.xml

我可以通过maven-war-plugin获得在实际生成的war文件中展开的属性。但我似乎无法获得在target/myproject/WEB-INF/components.xml中扩展的属性。

这意味着当我尝试运行Jetty插件时,它看不到扩展的属性。

我尝试在外部文件中定义属性,并且在构建中也是如此。我的个人资料部分如下所示:

<profiles> 
     <profile> 
      <id>dev</id> 

      <activation> 
       <activeByDefault>true</activeByDefault> 
      </activation> 

      <build> 
       <filters> 
        <filter>src/main/filters/components-dev.properties</filter> 
       </filters> 
      </build> 

     <properties> 
      <debug>true</debug> 
      <jndiPattern>FOO</jndiPattern> 
     </properties> 

     </profile> 
    </profiles> 

回答

0

当你运行mvn jetty:run它通过test-compile执行生命周期了。在战争插件作为package的一部分运行之前,网络资源不会被过滤。我发现了一个似乎相似的question on stackoverflow,该解决方案是否适合您?