Maven:过滤目标目录中的seam components.xml

时间:2011-09-04 19:25:04

标签: maven

我正在尝试将Ant项目转换为Maven。现有构建使用src/main/webapp/WEB-INF/components.xml中的Ant样式属性,这是一个Seam文件。

我可以通过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>

1 个答案:

答案 0 :(得分:0)

当您运行mvn jetty:run时,它会通过test-compile执行生命周期。在war插件作为package的一部分运行之前,不会过滤Web资源。我找到了一个似乎相似的question on stackoverflow,这个解决方案对你有用吗?