Index: src/main/java/org/codehaus/mojo/tomcat/AbstractDeployMojo.java
===================================================================
--- src/main/java/org/codehaus/mojo/tomcat/AbstractDeployMojo.java	(revision 7179)
+++ src/main/java/org/codehaus/mojo/tomcat/AbstractDeployMojo.java	(working copy)
@@ -39,7 +39,7 @@
      * deploy the war, <code>context</code> to deploy the context XML file, or
      * <code>both</code> to deploy the war with the context XML file. 
      * 
-     * @parameter expression = "${maven.tomcat.mode}" default-value = "war"
+     * @parameter expression = "${maven.tomcat.mode}" default-value = "war"            
      * @required
      */
     private String mode;
Index: src/main/java/org/codehaus/mojo/tomcat/AbstractRunMojo.java
===================================================================
--- src/main/java/org/codehaus/mojo/tomcat/AbstractRunMojo.java	(revision 7179)
+++ src/main/java/org/codehaus/mojo/tomcat/AbstractRunMojo.java	(working copy)
@@ -79,6 +79,13 @@
      */
     private int port;
 
+    /**
+     * The path of the Tomcat context XML file.
+     *
+     * @parameter expression = "${project.build.directory}/${project.build.finalName}/META-INF/context.xml"
+     */
+    private File contextFile;
+
     // ----------------------------------------------------------------------
     // Fields
     // ----------------------------------------------------------------------
@@ -187,6 +194,9 @@
 
             copyFile( "/conf/tomcat-users.xml", new File( confDir, "tomcat-users.xml" ) );
             copyFile( "/conf/web.xml", new File( confDir, "web.xml" ) );
+            if(contextFile.exists()){
+            	FileUtils.copyFile( contextFile, new File(confDir,"context.xml") );
+            }
 
             File webappsDir = new File( configurationDirFile, "webapps" );
             webappsDir.mkdir();
@@ -227,6 +237,7 @@
     {
         // create server
         container = new Embedded();
+        container.setUseNaming(true);
         container.setCatalinaHome( configurationDir );
         container.setRealm( new MemoryRealm() );
 
Index: src/site/apt/configuration.apt
===================================================================
--- src/site/apt/configuration.apt	(revision 7179)
+++ src/site/apt/configuration.apt	(working copy)
@@ -89,3 +89,18 @@
 	</configuration>
 </plugin>
 +--
+
+* Specifying a context file
+
+ The default context file is <<<$\{project.build.directory\}/$\{project.build.finalName\}/META-INF/context.xml>>>.
+
+ A different context file may be used by specifying <<<contextFile>>> in the pom.xml:
+ 
++--
+<configuration>
+	<contextFile>src/test/resources/mycontexts/test-context.xml</contextFile>
+</configuration>
++--
+
+ The ideal method is to set the value is with a variable.
+ By using a variable, different profiles could use different contexts (usually, different JNDI values).
\ No newline at end of file

