开发者

Maven: filtering seam components.xml in target directory

开发者 https://www.devze.com 2023-04-02 15:17 出处:网络
I\'m trying to convert an Ant project to Maven. The existing build uses Ant-style properties in src/main/webapp/WEB-INF/components.xml, which is a Seam file.

I'm trying to convert an Ant project to Maven. The existing build uses Ant-style properties in src/main/webapp/WEB-INF/components.xml, which is a Seam file.

I'm able to get the properties expanded in the actual resulting war file, via the maven-war-plugin. But I can't seem to get the properties expanded in target/myproject/WEB-INF/components.xml.

This means that when I try to run the Jetty plugin, it doesn't see the expanded properties.

I tried defining the properties in both an external file, and also right in the build. My profile section looks like the following:

  <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>
            <开发者_StackOverflow中文版jndiPattern>FOO</jndiPattern>
        </properties>

       </profile>
  </profiles>


When you run mvn jetty:run it executes the lifecycle up through test-compile. The web resources don't get filtered until the war plugin runs as part of package. I found a question on stackoverflow that seems similar, does that solution work for you?

0

精彩评论

暂无评论...
验证码 换一张
取 消