tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bin Lan <lan...@gmail.com>
Subject contextFile does not work with profiles?
Date Mon, 07 Nov 2011 14:18:19 GMT
Hi All,

I am trying to use tomcat maven plugin with different profiles to get
different JNDI parameters so I can connect to different database. But the
plugin seems to ignore the <contextFile> on the profile section. Here is
some snapshots of my configuration:

    <profiles>
        <profile>
            <id>production</id>
            <activation><activeByDefault>true</activeByDefault></activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-plugin</artifactId>
                        <configuration>

<containerConfigXML>${basedir}WebContent/META-INF/production/context.xml</containerConfigXML>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.tomcat.maven</groupId>
                        <artifactId>tomcat6-maven-plugin</artifactId>
                        <configuration>

<contextFile>WebContent/WEB-INF/production/context.xml</contextFile>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>staging</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-plugin</artifactId>
                        <configuration>

<containerConfigXML>WebContent/META-INF/staging/context.xml</containerConfigXML>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.tomcat.maven</groupId>
                        <artifactId>tomcat6-maven-plugin</artifactId>
                        <configuration>

<contextFile>WebContent/WEB-INF/staging/context.xml</contextFile>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>development</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-plugin</artifactId>
                        <configuration>

<containerConfigXML>WebContent/META-INF/development/context.xml</containerConfigXML>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.tomcat.maven</groupId>
                        <artifactId>tomcat6-maven-plugin</artifactId>
                        <configuration>

<contextFile>WebContent/WEB-INF/development/context.xml</contextFile>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>


Here is for tomcat plugin:

              <plugin>
                  <groupId>org.apache.tomcat.maven</groupId>
                  <artifactId>tomcat6-maven-plugin</artifactId>
                  <version>2.0-SNAPSHOT</version>
                  <configuration>

<warSourceDirectory>${basedir}/WebContent</warSourceDirectory>
                      <contextReloadable>true</contextReloadable>
                  </configuration>
            </plugin>


Any suggestions?

Regards
Bin

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message