tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1537824 [9/10] - in /tomcat/site/trunk/docs/maven-plugin-trunk: ./ apidocs/ apidocs/org/apache/tomcat/maven/common/deployer/class-use/ apidocs/org/apache/tomcat/maven/plugin/tomcat6/ apidocs/org/apache/tomcat/maven/plugin/tomcat7/run/ comm...
Date Fri, 01 Nov 2013 05:14:14 GMT
Modified: tomcat/site/trunk/docs/maven-plugin-trunk/tomcat7-maven-plugin/xref/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.html
URL: http://svn.apache.org/viewvc/tomcat/site/trunk/docs/maven-plugin-trunk/tomcat7-maven-plugin/xref/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.html?rev=1537824&r1=1537823&r2=1537824&view=diff
==============================================================================
--- tomcat/site/trunk/docs/maven-plugin-trunk/tomcat7-maven-plugin/xref/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.html (original)
+++ tomcat/site/trunk/docs/maven-plugin-trunk/tomcat7-maven-plugin/xref/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.html Fri Nov  1 05:14:09 2013
@@ -493,959 +493,1056 @@
 <a class="jxr_linenumber" name="483" href="#483">483</a>     @Parameter( property = <span class="jxr_string">"maven.tomcat.jarScan.allDirectories"</span>, defaultValue = <span class="jxr_string">"true"</span> )
 <a class="jxr_linenumber" name="484" href="#484">484</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">boolean</strong> jarScanAllDirectories = <strong class="jxr_keyword">true</strong>;
 <a class="jxr_linenumber" name="485" href="#485">485</a> 
-<a class="jxr_linenumber" name="486" href="#486">486</a>     <em class="jxr_comment">// ----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="487" href="#487">487</a>     <em class="jxr_comment">// Fields</em>
-<a class="jxr_linenumber" name="488" href="#488">488</a>     <em class="jxr_comment">// ----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="489" href="#489">489</a> 
-<a class="jxr_linenumber" name="490" href="#490">490</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="491" href="#491">491</a> <em class="jxr_javadoccomment">     * @since 1.0</em>
-<a class="jxr_linenumber" name="492" href="#492">492</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="493" href="#493">493</a>     <strong class="jxr_keyword">private</strong> ClassRealm tomcatRealm;
-<a class="jxr_linenumber" name="494" href="#494">494</a> 
-<a class="jxr_linenumber" name="495" href="#495">495</a>     <em class="jxr_comment">// ----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="496" href="#496">496</a>     <em class="jxr_comment">// Mojo Implementation</em>
-<a class="jxr_linenumber" name="497" href="#497">497</a>     <em class="jxr_comment">// ----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="498" href="#498">498</a> 
-<a class="jxr_linenumber" name="499" href="#499">499</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="500" href="#500">500</a> <em class="jxr_javadoccomment">     * {@inheritDoc}</em>
-<a class="jxr_linenumber" name="501" href="#501">501</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="502" href="#502">502</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> execute()
-<a class="jxr_linenumber" name="503" href="#503">503</a>         <strong class="jxr_keyword">throws</strong> MojoExecutionException, MojoFailureException
-<a class="jxr_linenumber" name="504" href="#504">504</a>     {
-<a class="jxr_linenumber" name="505" href="#505">505</a>         <strong class="jxr_keyword">if</strong> ( skip )
-<a class="jxr_linenumber" name="506" href="#506">506</a>         {
-<a class="jxr_linenumber" name="507" href="#507">507</a>             getLog().info( <span class="jxr_string">"skip execution"</span> );
-<a class="jxr_linenumber" name="508" href="#508">508</a>             <strong class="jxr_keyword">return</strong>;
-<a class="jxr_linenumber" name="509" href="#509">509</a>         }
-<a class="jxr_linenumber" name="510" href="#510">510</a>         <em class="jxr_comment">// ensure project is a web application</em>
-<a class="jxr_linenumber" name="511" href="#511">511</a>         <strong class="jxr_keyword">if</strong> ( !isWar() &amp;&amp; !addContextWarDependencies &amp;&amp; getAdditionalWebapps().isEmpty() )
-<a class="jxr_linenumber" name="512" href="#512">512</a>         {
-<a class="jxr_linenumber" name="513" href="#513">513</a>             getLog().info( messagesProvider.getMessage( <span class="jxr_string">"AbstractRunMojo.nonWar"</span> ) );
-<a class="jxr_linenumber" name="514" href="#514">514</a>             <strong class="jxr_keyword">return</strong>;
-<a class="jxr_linenumber" name="515" href="#515">515</a>         }
-<a class="jxr_linenumber" name="516" href="#516">516</a>         ClassLoader originalClassLoader = <strong class="jxr_keyword">null</strong>;
-<a class="jxr_linenumber" name="517" href="#517">517</a>         <strong class="jxr_keyword">if</strong> ( useSeparateTomcatClassLoader )
-<a class="jxr_linenumber" name="518" href="#518">518</a>         {
-<a class="jxr_linenumber" name="519" href="#519">519</a>             originalClassLoader = Thread.currentThread().getContextClassLoader();
-<a class="jxr_linenumber" name="520" href="#520">520</a>         }
-<a class="jxr_linenumber" name="521" href="#521">521</a>         <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="522" href="#522">522</a>         {
-<a class="jxr_linenumber" name="523" href="#523">523</a>             getLog().info( messagesProvider.getMessage( <span class="jxr_string">"AbstractRunMojo.runningWar"</span>, getWebappUrl() ) );
-<a class="jxr_linenumber" name="524" href="#524">524</a> 
-<a class="jxr_linenumber" name="525" href="#525">525</a>             initConfiguration();
-<a class="jxr_linenumber" name="526" href="#526">526</a>             startContainer();
-<a class="jxr_linenumber" name="527" href="#527">527</a>             <strong class="jxr_keyword">if</strong> ( !fork )
-<a class="jxr_linenumber" name="528" href="#528">528</a>             {
-<a class="jxr_linenumber" name="529" href="#529">529</a>                 waitIndefinitely();
-<a class="jxr_linenumber" name="530" href="#530">530</a>             }
-<a class="jxr_linenumber" name="531" href="#531">531</a>         }
-<a class="jxr_linenumber" name="532" href="#532">532</a>         <strong class="jxr_keyword">catch</strong> ( LifecycleException exception )
-<a class="jxr_linenumber" name="533" href="#533">533</a>         {
-<a class="jxr_linenumber" name="534" href="#534">534</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( messagesProvider.getMessage( <span class="jxr_string">"AbstractRunMojo.cannotStart"</span> ), exception );
-<a class="jxr_linenumber" name="535" href="#535">535</a>         }
-<a class="jxr_linenumber" name="536" href="#536">536</a>         <strong class="jxr_keyword">catch</strong> ( IOException exception )
-<a class="jxr_linenumber" name="537" href="#537">537</a>         {
-<a class="jxr_linenumber" name="538" href="#538">538</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException(
-<a class="jxr_linenumber" name="539" href="#539">539</a>                 messagesProvider.getMessage( <span class="jxr_string">"AbstractRunMojo.cannotCreateConfiguration"</span> ), exception );
-<a class="jxr_linenumber" name="540" href="#540">540</a>         }
-<a class="jxr_linenumber" name="541" href="#541">541</a>         <strong class="jxr_keyword">catch</strong> ( ServletException e )
-<a class="jxr_linenumber" name="542" href="#542">542</a>         {
-<a class="jxr_linenumber" name="543" href="#543">543</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( e.getMessage(), e );
-<a class="jxr_linenumber" name="544" href="#544">544</a>         }
-<a class="jxr_linenumber" name="545" href="#545">545</a>         <strong class="jxr_keyword">catch</strong> ( MavenFilteringException e )
-<a class="jxr_linenumber" name="546" href="#546">546</a>         {
-<a class="jxr_linenumber" name="547" href="#547">547</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( <span class="jxr_string">"filtering issue: "</span> + e.getMessage(), e );
-<a class="jxr_linenumber" name="548" href="#548">548</a>         }
-<a class="jxr_linenumber" name="549" href="#549">549</a>         <strong class="jxr_keyword">finally</strong>
-<a class="jxr_linenumber" name="550" href="#550">550</a>         {
-<a class="jxr_linenumber" name="551" href="#551">551</a>             <strong class="jxr_keyword">if</strong> ( useSeparateTomcatClassLoader )
-<a class="jxr_linenumber" name="552" href="#552">552</a>             {
-<a class="jxr_linenumber" name="553" href="#553">553</a>                 Thread.currentThread().setContextClassLoader( originalClassLoader );
-<a class="jxr_linenumber" name="554" href="#554">554</a>             }
-<a class="jxr_linenumber" name="555" href="#555">555</a>         }
-<a class="jxr_linenumber" name="556" href="#556">556</a>     }
-<a class="jxr_linenumber" name="557" href="#557">557</a> 
-<a class="jxr_linenumber" name="558" href="#558">558</a>     <em class="jxr_comment">// ----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="559" href="#559">559</a>     <em class="jxr_comment">// Protected Methods</em>
-<a class="jxr_linenumber" name="560" href="#560">560</a>     <em class="jxr_comment">// ----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="561" href="#561">561</a> 
-<a class="jxr_linenumber" name="562" href="#562">562</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="563" href="#563">563</a> <em class="jxr_javadoccomment">     * Gets the webapp context path to use for the web application being run.</em>
-<a class="jxr_linenumber" name="564" href="#564">564</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="565" href="#565">565</a> <em class="jxr_javadoccomment">     * @return the webapp context path</em>
-<a class="jxr_linenumber" name="566" href="#566">566</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="567" href="#567">567</a>     <strong class="jxr_keyword">protected</strong> String getPath()
-<a class="jxr_linenumber" name="568" href="#568">568</a>     {
-<a class="jxr_linenumber" name="569" href="#569">569</a>         <strong class="jxr_keyword">return</strong> path;
-<a class="jxr_linenumber" name="570" href="#570">570</a>     }
-<a class="jxr_linenumber" name="571" href="#571">571</a> 
-<a class="jxr_linenumber" name="572" href="#572">572</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="573" href="#573">573</a> <em class="jxr_javadoccomment">     * Gets the context to run this web application under for the specified embedded Tomcat.</em>
-<a class="jxr_linenumber" name="574" href="#574">574</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="575" href="#575">575</a> <em class="jxr_javadoccomment">     * @param container the embedded Tomcat container being used</em>
-<a class="jxr_linenumber" name="576" href="#576">576</a> <em class="jxr_javadoccomment">     * @return the context to run this web application under</em>
-<a class="jxr_linenumber" name="577" href="#577">577</a> <em class="jxr_javadoccomment">     * @throws IOException            if the context could not be created</em>
-<a class="jxr_linenumber" name="578" href="#578">578</a> <em class="jxr_javadoccomment">     * @throws MojoExecutionException in case of an error creating the context</em>
-<a class="jxr_linenumber" name="579" href="#579">579</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="580" href="#580">580</a>     <strong class="jxr_keyword">protected</strong> Context createContext( Tomcat container )
-<a class="jxr_linenumber" name="581" href="#581">581</a>         <strong class="jxr_keyword">throws</strong> IOException, MojoExecutionException, ServletException
-<a class="jxr_linenumber" name="582" href="#582">582</a>     {
-<a class="jxr_linenumber" name="583" href="#583">583</a>         String contextPath = getPath();
-<a class="jxr_linenumber" name="584" href="#584">584</a> 
-<a class="jxr_linenumber" name="585" href="#585">585</a>         String baseDir = getDocBase().getAbsolutePath();
-<a class="jxr_linenumber" name="586" href="#586">586</a> 
-<a class="jxr_linenumber" name="587" href="#587">587</a>         File overriddenContextFile = getContextFile();
-<a class="jxr_linenumber" name="588" href="#588">588</a> 
-<a class="jxr_linenumber" name="589" href="#589">589</a>         StandardContext standardContext = <strong class="jxr_keyword">null</strong>;
-<a class="jxr_linenumber" name="590" href="#590">590</a> 
-<a class="jxr_linenumber" name="591" href="#591">591</a>         <strong class="jxr_keyword">if</strong> ( overriddenContextFile != <strong class="jxr_keyword">null</strong> &amp;&amp; overriddenContextFile.exists() )
-<a class="jxr_linenumber" name="592" href="#592">592</a>         {
-<a class="jxr_linenumber" name="593" href="#593">593</a>             standardContext = parseContextFile( overriddenContextFile );
-<a class="jxr_linenumber" name="594" href="#594">594</a>         }
-<a class="jxr_linenumber" name="595" href="#595">595</a>         <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> ( defaultContextFile.exists() )
-<a class="jxr_linenumber" name="596" href="#596">596</a>         {
-<a class="jxr_linenumber" name="597" href="#597">597</a>             standardContext = parseContextFile( defaultContextFile );
-<a class="jxr_linenumber" name="598" href="#598">598</a>         }
-<a class="jxr_linenumber" name="599" href="#599">599</a> 
-<a class="jxr_linenumber" name="600" href="#600">600</a>         <strong class="jxr_keyword">if</strong> ( standardContext != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="601" href="#601">601</a>         {
-<a class="jxr_linenumber" name="602" href="#602">602</a>             <strong class="jxr_keyword">if</strong> ( standardContext.getPath() != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="603" href="#603">603</a>             {
-<a class="jxr_linenumber" name="604" href="#604">604</a>                 contextPath = standardContext.getPath();
-<a class="jxr_linenumber" name="605" href="#605">605</a>             }
-<a class="jxr_linenumber" name="606" href="#606">606</a>             <strong class="jxr_keyword">if</strong> ( standardContext.getDocBase() != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="607" href="#607">607</a>             {
-<a class="jxr_linenumber" name="608" href="#608">608</a>                 baseDir = standardContext.getDocBase();
-<a class="jxr_linenumber" name="609" href="#609">609</a>             }
-<a class="jxr_linenumber" name="610" href="#610">610</a>         }
-<a class="jxr_linenumber" name="611" href="#611">611</a> 
-<a class="jxr_linenumber" name="612" href="#612">612</a>         contextPath = <span class="jxr_string">"/"</span>.equals( contextPath ) ? <span class="jxr_string">""</span> : contextPath;
+<a class="jxr_linenumber" name="486" href="#486">486</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="487" href="#487">487</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="488" href="#488">488</a> <em class="jxr_javadoccomment">     * @since 2.2</em>
+<a class="jxr_linenumber" name="489" href="#489">489</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="490" href="#490">490</a>     @Parameter( property = <span class="jxr_string">"maven.tomcat.useBodyEncodingForURI"</span>, defaultValue = <span class="jxr_string">"false"</span> )
+<a class="jxr_linenumber" name="491" href="#491">491</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">boolean</strong> useBodyEncodingForURI;
+<a class="jxr_linenumber" name="492" href="#492">492</a> 
+<a class="jxr_linenumber" name="493" href="#493">493</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="494" href="#494">494</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="495" href="#495">495</a> <em class="jxr_javadoccomment">     * @since 2.2</em>
+<a class="jxr_linenumber" name="496" href="#496">496</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="497" href="#497">497</a>     @Parameter
+<a class="jxr_linenumber" name="498" href="#498">498</a>     <strong class="jxr_keyword">protected</strong> String trustManagerClassName;
+<a class="jxr_linenumber" name="499" href="#499">499</a> 
+<a class="jxr_linenumber" name="500" href="#500">500</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="501" href="#501">501</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="502" href="#502">502</a> <em class="jxr_javadoccomment">     * @since 2.2</em>
+<a class="jxr_linenumber" name="503" href="#503">503</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="504" href="#504">504</a>     @Parameter
+<a class="jxr_linenumber" name="505" href="#505">505</a>     <strong class="jxr_keyword">protected</strong> String trustMaxCertLength;
+<a class="jxr_linenumber" name="506" href="#506">506</a> 
+<a class="jxr_linenumber" name="507" href="#507">507</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="508" href="#508">508</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="509" href="#509">509</a> <em class="jxr_javadoccomment">     * @since 2.2</em>
+<a class="jxr_linenumber" name="510" href="#510">510</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="511" href="#511">511</a>     @Parameter
+<a class="jxr_linenumber" name="512" href="#512">512</a>     <strong class="jxr_keyword">protected</strong> String truststoreAlgorithm;
+<a class="jxr_linenumber" name="513" href="#513">513</a> 
+<a class="jxr_linenumber" name="514" href="#514">514</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="515" href="#515">515</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="516" href="#516">516</a> <em class="jxr_javadoccomment">     * @since 2.2</em>
+<a class="jxr_linenumber" name="517" href="#517">517</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="518" href="#518">518</a>     @Parameter
+<a class="jxr_linenumber" name="519" href="#519">519</a>     <strong class="jxr_keyword">protected</strong> String truststoreFile;
+<a class="jxr_linenumber" name="520" href="#520">520</a> 
+<a class="jxr_linenumber" name="521" href="#521">521</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="522" href="#522">522</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="523" href="#523">523</a> <em class="jxr_javadoccomment">     * @since 2.2</em>
+<a class="jxr_linenumber" name="524" href="#524">524</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="525" href="#525">525</a>     @Parameter
+<a class="jxr_linenumber" name="526" href="#526">526</a>     <strong class="jxr_keyword">protected</strong> String  truststorePass;
+<a class="jxr_linenumber" name="527" href="#527">527</a> 
+<a class="jxr_linenumber" name="528" href="#528">528</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="529" href="#529">529</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="530" href="#530">530</a> <em class="jxr_javadoccomment">     * @since 2.2</em>
+<a class="jxr_linenumber" name="531" href="#531">531</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="532" href="#532">532</a>     @Parameter
+<a class="jxr_linenumber" name="533" href="#533">533</a>     <strong class="jxr_keyword">protected</strong> String truststoreProvider;
+<a class="jxr_linenumber" name="534" href="#534">534</a> 
+<a class="jxr_linenumber" name="535" href="#535">535</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="536" href="#536">536</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="537" href="#537">537</a> <em class="jxr_javadoccomment">     * @since 2.2</em>
+<a class="jxr_linenumber" name="538" href="#538">538</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="539" href="#539">539</a>     @Parameter
+<a class="jxr_linenumber" name="540" href="#540">540</a>     <strong class="jxr_keyword">protected</strong> String truststoreType;
+<a class="jxr_linenumber" name="541" href="#541">541</a> 
+<a class="jxr_linenumber" name="542" href="#542">542</a>     <em class="jxr_comment">// ----------------------------------------------------------------------</em>
+<a class="jxr_linenumber" name="543" href="#543">543</a>     <em class="jxr_comment">// Fields</em>
+<a class="jxr_linenumber" name="544" href="#544">544</a>     <em class="jxr_comment">// ----------------------------------------------------------------------</em>
+<a class="jxr_linenumber" name="545" href="#545">545</a> 
+<a class="jxr_linenumber" name="546" href="#546">546</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="547" href="#547">547</a> <em class="jxr_javadoccomment">     * @since 1.0</em>
+<a class="jxr_linenumber" name="548" href="#548">548</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="549" href="#549">549</a>     <strong class="jxr_keyword">private</strong> ClassRealm tomcatRealm;
+<a class="jxr_linenumber" name="550" href="#550">550</a> 
+<a class="jxr_linenumber" name="551" href="#551">551</a>     <em class="jxr_comment">// ----------------------------------------------------------------------</em>
+<a class="jxr_linenumber" name="552" href="#552">552</a>     <em class="jxr_comment">// Mojo Implementation</em>
+<a class="jxr_linenumber" name="553" href="#553">553</a>     <em class="jxr_comment">// ----------------------------------------------------------------------</em>
+<a class="jxr_linenumber" name="554" href="#554">554</a> 
+<a class="jxr_linenumber" name="555" href="#555">555</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="556" href="#556">556</a> <em class="jxr_javadoccomment">     * {@inheritDoc}</em>
+<a class="jxr_linenumber" name="557" href="#557">557</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="558" href="#558">558</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> execute()
+<a class="jxr_linenumber" name="559" href="#559">559</a>         <strong class="jxr_keyword">throws</strong> MojoExecutionException, MojoFailureException
+<a class="jxr_linenumber" name="560" href="#560">560</a>     {
+<a class="jxr_linenumber" name="561" href="#561">561</a>         <strong class="jxr_keyword">if</strong> ( skip )
+<a class="jxr_linenumber" name="562" href="#562">562</a>         {
+<a class="jxr_linenumber" name="563" href="#563">563</a>             getLog().info( <span class="jxr_string">"skip execution"</span> );
+<a class="jxr_linenumber" name="564" href="#564">564</a>             <strong class="jxr_keyword">return</strong>;
+<a class="jxr_linenumber" name="565" href="#565">565</a>         }
+<a class="jxr_linenumber" name="566" href="#566">566</a>         <em class="jxr_comment">// ensure project is a web application</em>
+<a class="jxr_linenumber" name="567" href="#567">567</a>         <strong class="jxr_keyword">if</strong> ( !isWar() &amp;&amp; !addContextWarDependencies &amp;&amp; getAdditionalWebapps().isEmpty() )
+<a class="jxr_linenumber" name="568" href="#568">568</a>         {
+<a class="jxr_linenumber" name="569" href="#569">569</a>             getLog().info( messagesProvider.getMessage( <span class="jxr_string">"AbstractRunMojo.nonWar"</span> ) );
+<a class="jxr_linenumber" name="570" href="#570">570</a>             <strong class="jxr_keyword">return</strong>;
+<a class="jxr_linenumber" name="571" href="#571">571</a>         }
+<a class="jxr_linenumber" name="572" href="#572">572</a>         ClassLoader originalClassLoader = <strong class="jxr_keyword">null</strong>;
+<a class="jxr_linenumber" name="573" href="#573">573</a>         <strong class="jxr_keyword">if</strong> ( useSeparateTomcatClassLoader )
+<a class="jxr_linenumber" name="574" href="#574">574</a>         {
+<a class="jxr_linenumber" name="575" href="#575">575</a>             originalClassLoader = Thread.currentThread().getContextClassLoader();
+<a class="jxr_linenumber" name="576" href="#576">576</a>         }
+<a class="jxr_linenumber" name="577" href="#577">577</a>         <strong class="jxr_keyword">try</strong>
+<a class="jxr_linenumber" name="578" href="#578">578</a>         {
+<a class="jxr_linenumber" name="579" href="#579">579</a>             getLog().info( messagesProvider.getMessage( <span class="jxr_string">"AbstractRunMojo.runningWar"</span>, getWebappUrl() ) );
+<a class="jxr_linenumber" name="580" href="#580">580</a> 
+<a class="jxr_linenumber" name="581" href="#581">581</a>             initConfiguration();
+<a class="jxr_linenumber" name="582" href="#582">582</a>             startContainer();
+<a class="jxr_linenumber" name="583" href="#583">583</a>             <strong class="jxr_keyword">if</strong> ( !fork )
+<a class="jxr_linenumber" name="584" href="#584">584</a>             {
+<a class="jxr_linenumber" name="585" href="#585">585</a>                 waitIndefinitely();
+<a class="jxr_linenumber" name="586" href="#586">586</a>             }
+<a class="jxr_linenumber" name="587" href="#587">587</a>         }
+<a class="jxr_linenumber" name="588" href="#588">588</a>         <strong class="jxr_keyword">catch</strong> ( LifecycleException exception )
+<a class="jxr_linenumber" name="589" href="#589">589</a>         {
+<a class="jxr_linenumber" name="590" href="#590">590</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( messagesProvider.getMessage( <span class="jxr_string">"AbstractRunMojo.cannotStart"</span> ), exception );
+<a class="jxr_linenumber" name="591" href="#591">591</a>         }
+<a class="jxr_linenumber" name="592" href="#592">592</a>         <strong class="jxr_keyword">catch</strong> ( IOException exception )
+<a class="jxr_linenumber" name="593" href="#593">593</a>         {
+<a class="jxr_linenumber" name="594" href="#594">594</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException(
+<a class="jxr_linenumber" name="595" href="#595">595</a>                 messagesProvider.getMessage( <span class="jxr_string">"AbstractRunMojo.cannotCreateConfiguration"</span> ), exception );
+<a class="jxr_linenumber" name="596" href="#596">596</a>         }
+<a class="jxr_linenumber" name="597" href="#597">597</a>         <strong class="jxr_keyword">catch</strong> ( ServletException e )
+<a class="jxr_linenumber" name="598" href="#598">598</a>         {
+<a class="jxr_linenumber" name="599" href="#599">599</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( e.getMessage(), e );
+<a class="jxr_linenumber" name="600" href="#600">600</a>         }
+<a class="jxr_linenumber" name="601" href="#601">601</a>         <strong class="jxr_keyword">catch</strong> ( MavenFilteringException e )
+<a class="jxr_linenumber" name="602" href="#602">602</a>         {
+<a class="jxr_linenumber" name="603" href="#603">603</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( <span class="jxr_string">"filtering issue: "</span> + e.getMessage(), e );
+<a class="jxr_linenumber" name="604" href="#604">604</a>         }
+<a class="jxr_linenumber" name="605" href="#605">605</a>         <strong class="jxr_keyword">finally</strong>
+<a class="jxr_linenumber" name="606" href="#606">606</a>         {
+<a class="jxr_linenumber" name="607" href="#607">607</a>             <strong class="jxr_keyword">if</strong> ( useSeparateTomcatClassLoader )
+<a class="jxr_linenumber" name="608" href="#608">608</a>             {
+<a class="jxr_linenumber" name="609" href="#609">609</a>                 Thread.currentThread().setContextClassLoader( originalClassLoader );
+<a class="jxr_linenumber" name="610" href="#610">610</a>             }
+<a class="jxr_linenumber" name="611" href="#611">611</a>         }
+<a class="jxr_linenumber" name="612" href="#612">612</a>     }
 <a class="jxr_linenumber" name="613" href="#613">613</a> 
-<a class="jxr_linenumber" name="614" href="#614">614</a>         getLog().info( <span class="jxr_string">"create webapp with contextPath: "</span> + contextPath );
-<a class="jxr_linenumber" name="615" href="#615">615</a> 
-<a class="jxr_linenumber" name="616" href="#616">616</a>         Context context = container.addWebapp( contextPath, baseDir );
+<a class="jxr_linenumber" name="614" href="#614">614</a>     <em class="jxr_comment">// ----------------------------------------------------------------------</em>
+<a class="jxr_linenumber" name="615" href="#615">615</a>     <em class="jxr_comment">// Protected Methods</em>
+<a class="jxr_linenumber" name="616" href="#616">616</a>     <em class="jxr_comment">// ----------------------------------------------------------------------</em>
 <a class="jxr_linenumber" name="617" href="#617">617</a> 
-<a class="jxr_linenumber" name="618" href="#618">618</a>         context.setResources(
-<a class="jxr_linenumber" name="619" href="#619">619</a>             <strong class="jxr_keyword">new</strong> <a href="../../../../../../../org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.html">MyDirContext</a>( <strong class="jxr_keyword">new</strong> File( project.getBuild().getOutputDirectory() ).getAbsolutePath() ) );
-<a class="jxr_linenumber" name="620" href="#620">620</a> 
-<a class="jxr_linenumber" name="621" href="#621">621</a>         <strong class="jxr_keyword">if</strong> ( useSeparateTomcatClassLoader )
-<a class="jxr_linenumber" name="622" href="#622">622</a>         {
-<a class="jxr_linenumber" name="623" href="#623">623</a>             context.setParentClassLoader( getTomcatClassLoader() );
-<a class="jxr_linenumber" name="624" href="#624">624</a>         }
-<a class="jxr_linenumber" name="625" href="#625">625</a> 
-<a class="jxr_linenumber" name="626" href="#626">626</a>         <strong class="jxr_keyword">final</strong> WebappLoader loader = createWebappLoader();
+<a class="jxr_linenumber" name="618" href="#618">618</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="619" href="#619">619</a> <em class="jxr_javadoccomment">     * Gets the webapp context path to use for the web application being run.</em>
+<a class="jxr_linenumber" name="620" href="#620">620</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="621" href="#621">621</a> <em class="jxr_javadoccomment">     * @return the webapp context path</em>
+<a class="jxr_linenumber" name="622" href="#622">622</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="623" href="#623">623</a>     <strong class="jxr_keyword">protected</strong> String getPath()
+<a class="jxr_linenumber" name="624" href="#624">624</a>     {
+<a class="jxr_linenumber" name="625" href="#625">625</a>         <strong class="jxr_keyword">return</strong> path;
+<a class="jxr_linenumber" name="626" href="#626">626</a>     }
 <a class="jxr_linenumber" name="627" href="#627">627</a> 
-<a class="jxr_linenumber" name="628" href="#628">628</a>         context.setLoader( loader );
-<a class="jxr_linenumber" name="629" href="#629">629</a> 
-<a class="jxr_linenumber" name="630" href="#630">630</a>         <strong class="jxr_keyword">if</strong> ( overriddenContextFile != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="631" href="#631">631</a>         {
-<a class="jxr_linenumber" name="632" href="#632">632</a>             <em class="jxr_comment">// here, send file to Tomcat for it to complain if missing</em>
-<a class="jxr_linenumber" name="633" href="#633">633</a>             context.setConfigFile( overriddenContextFile.toURI().toURL() );
-<a class="jxr_linenumber" name="634" href="#634">634</a>         }
-<a class="jxr_linenumber" name="635" href="#635">635</a>         <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> ( defaultContextFile.exists() )
-<a class="jxr_linenumber" name="636" href="#636">636</a>         {
-<a class="jxr_linenumber" name="637" href="#637">637</a>             <em class="jxr_comment">// here, only sending default file if it indeed exists</em>
-<a class="jxr_linenumber" name="638" href="#638">638</a>             <em class="jxr_comment">// otherwise Tomcat will create a default context</em>
-<a class="jxr_linenumber" name="639" href="#639">639</a>             context.setConfigFile( defaultContextFile.toURI().toURL() );
-<a class="jxr_linenumber" name="640" href="#640">640</a>         }
-<a class="jxr_linenumber" name="641" href="#641">641</a> 
-<a class="jxr_linenumber" name="642" href="#642">642</a>         <strong class="jxr_keyword">if</strong> ( classLoaderClass != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="643" href="#643">643</a>         {
-<a class="jxr_linenumber" name="644" href="#644">644</a>             loader.setLoaderClass( classLoaderClass );
-<a class="jxr_linenumber" name="645" href="#645">645</a>         }
+<a class="jxr_linenumber" name="628" href="#628">628</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="629" href="#629">629</a> <em class="jxr_javadoccomment">     * Gets the context to run this web application under for the specified embedded Tomcat.</em>
+<a class="jxr_linenumber" name="630" href="#630">630</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="631" href="#631">631</a> <em class="jxr_javadoccomment">     * @param container the embedded Tomcat container being used</em>
+<a class="jxr_linenumber" name="632" href="#632">632</a> <em class="jxr_javadoccomment">     * @return the context to run this web application under</em>
+<a class="jxr_linenumber" name="633" href="#633">633</a> <em class="jxr_javadoccomment">     * @throws IOException            if the context could not be created</em>
+<a class="jxr_linenumber" name="634" href="#634">634</a> <em class="jxr_javadoccomment">     * @throws MojoExecutionException in case of an error creating the context</em>
+<a class="jxr_linenumber" name="635" href="#635">635</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="636" href="#636">636</a>     <strong class="jxr_keyword">protected</strong> Context createContext( Tomcat container )
+<a class="jxr_linenumber" name="637" href="#637">637</a>         <strong class="jxr_keyword">throws</strong> IOException, MojoExecutionException, ServletException
+<a class="jxr_linenumber" name="638" href="#638">638</a>     {
+<a class="jxr_linenumber" name="639" href="#639">639</a>         String contextPath = getPath();
+<a class="jxr_linenumber" name="640" href="#640">640</a> 
+<a class="jxr_linenumber" name="641" href="#641">641</a>         String baseDir = getDocBase().getAbsolutePath();
+<a class="jxr_linenumber" name="642" href="#642">642</a> 
+<a class="jxr_linenumber" name="643" href="#643">643</a>         File overriddenContextFile = getContextFile();
+<a class="jxr_linenumber" name="644" href="#644">644</a> 
+<a class="jxr_linenumber" name="645" href="#645">645</a>         StandardContext standardContext = <strong class="jxr_keyword">null</strong>;
 <a class="jxr_linenumber" name="646" href="#646">646</a> 
-<a class="jxr_linenumber" name="647" href="#647">647</a>         <em class="jxr_comment">// https://issues.apache.org/jira/browse/MTOMCAT-239</em>
-<a class="jxr_linenumber" name="648" href="#648">648</a>         <em class="jxr_comment">// get the jar scanner to configure scanning directories as we can run a jar or a reactor project with a jar so</em>
-<a class="jxr_linenumber" name="649" href="#649">649</a>         <em class="jxr_comment">// the entries is a directory (target/classes)</em>
-<a class="jxr_linenumber" name="650" href="#650">650</a>         JarScanner jarScanner = context.getJarScanner();
-<a class="jxr_linenumber" name="651" href="#651">651</a> 
-<a class="jxr_linenumber" name="652" href="#652">652</a>         <em class="jxr_comment">// normally this one only but just in case ...</em>
-<a class="jxr_linenumber" name="653" href="#653">653</a>         <strong class="jxr_keyword">if</strong> ( jarScanner instanceof StandardJarScanner )
-<a class="jxr_linenumber" name="654" href="#654">654</a>         {
-<a class="jxr_linenumber" name="655" href="#655">655</a>             ( (StandardJarScanner) jarScanner ).setScanAllDirectories( jarScanAllDirectories );
-<a class="jxr_linenumber" name="656" href="#656">656</a>         }
-<a class="jxr_linenumber" name="657" href="#657">657</a> 
-<a class="jxr_linenumber" name="658" href="#658">658</a>         <strong class="jxr_keyword">return</strong> context;
-<a class="jxr_linenumber" name="659" href="#659">659</a> 
-<a class="jxr_linenumber" name="660" href="#660">660</a>     }
-<a class="jxr_linenumber" name="661" href="#661">661</a> 
-<a class="jxr_linenumber" name="662" href="#662">662</a>     <strong class="jxr_keyword">protected</strong> StandardContext parseContextFile( File file )
-<a class="jxr_linenumber" name="663" href="#663">663</a>         <strong class="jxr_keyword">throws</strong> MojoExecutionException
-<a class="jxr_linenumber" name="664" href="#664">664</a>     {
-<a class="jxr_linenumber" name="665" href="#665">665</a>         <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="666" href="#666">666</a>         {
-<a class="jxr_linenumber" name="667" href="#667">667</a>             StandardContext standardContext = <strong class="jxr_keyword">new</strong> StandardContext();
-<a class="jxr_linenumber" name="668" href="#668">668</a>             XMLStreamReader reader = XMLInputFactory.newFactory().createXMLStreamReader( <strong class="jxr_keyword">new</strong> FileInputStream( file ) );
+<a class="jxr_linenumber" name="647" href="#647">647</a>         <strong class="jxr_keyword">if</strong> ( overriddenContextFile != <strong class="jxr_keyword">null</strong> &amp;&amp; overriddenContextFile.exists() )
+<a class="jxr_linenumber" name="648" href="#648">648</a>         {
+<a class="jxr_linenumber" name="649" href="#649">649</a>             standardContext = parseContextFile( overriddenContextFile );
+<a class="jxr_linenumber" name="650" href="#650">650</a>         }
+<a class="jxr_linenumber" name="651" href="#651">651</a>         <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> ( defaultContextFile.exists() )
+<a class="jxr_linenumber" name="652" href="#652">652</a>         {
+<a class="jxr_linenumber" name="653" href="#653">653</a>             standardContext = parseContextFile( defaultContextFile );
+<a class="jxr_linenumber" name="654" href="#654">654</a>         }
+<a class="jxr_linenumber" name="655" href="#655">655</a> 
+<a class="jxr_linenumber" name="656" href="#656">656</a>         <strong class="jxr_keyword">if</strong> ( standardContext != <strong class="jxr_keyword">null</strong> )
+<a class="jxr_linenumber" name="657" href="#657">657</a>         {
+<a class="jxr_linenumber" name="658" href="#658">658</a>             <strong class="jxr_keyword">if</strong> ( standardContext.getPath() != <strong class="jxr_keyword">null</strong> )
+<a class="jxr_linenumber" name="659" href="#659">659</a>             {
+<a class="jxr_linenumber" name="660" href="#660">660</a>                 contextPath = standardContext.getPath();
+<a class="jxr_linenumber" name="661" href="#661">661</a>             }
+<a class="jxr_linenumber" name="662" href="#662">662</a>             <strong class="jxr_keyword">if</strong> ( standardContext.getDocBase() != <strong class="jxr_keyword">null</strong> )
+<a class="jxr_linenumber" name="663" href="#663">663</a>             {
+<a class="jxr_linenumber" name="664" href="#664">664</a>                 baseDir = standardContext.getDocBase();
+<a class="jxr_linenumber" name="665" href="#665">665</a>             }
+<a class="jxr_linenumber" name="666" href="#666">666</a>         }
+<a class="jxr_linenumber" name="667" href="#667">667</a> 
+<a class="jxr_linenumber" name="668" href="#668">668</a>         contextPath = <span class="jxr_string">"/"</span>.equals( contextPath ) ? <span class="jxr_string">""</span> : contextPath;
 <a class="jxr_linenumber" name="669" href="#669">669</a> 
-<a class="jxr_linenumber" name="670" href="#670">670</a>             <strong class="jxr_keyword">int</strong> tag = reader.next();
+<a class="jxr_linenumber" name="670" href="#670">670</a>         getLog().info( <span class="jxr_string">"create webapp with contextPath: "</span> + contextPath );
 <a class="jxr_linenumber" name="671" href="#671">671</a> 
-<a class="jxr_linenumber" name="672" href="#672">672</a>             <strong class="jxr_keyword">while</strong> ( <strong class="jxr_keyword">true</strong> )
-<a class="jxr_linenumber" name="673" href="#673">673</a>             {
-<a class="jxr_linenumber" name="674" href="#674">674</a>                 <strong class="jxr_keyword">if</strong> ( tag == XMLStreamConstants.START_ELEMENT &amp;&amp; StringUtils.equals( <span class="jxr_string">"Context"</span>, reader.getLocalName() ) )
-<a class="jxr_linenumber" name="675" href="#675">675</a>                 {
-<a class="jxr_linenumber" name="676" href="#676">676</a>                     String path = reader.getAttributeValue( <strong class="jxr_keyword">null</strong>, <span class="jxr_string">"path"</span> );
-<a class="jxr_linenumber" name="677" href="#677">677</a>                     <strong class="jxr_keyword">if</strong> ( StringUtils.isNotBlank( path ) )
-<a class="jxr_linenumber" name="678" href="#678">678</a>                     {
-<a class="jxr_linenumber" name="679" href="#679">679</a>                         standardContext.setPath( path );
-<a class="jxr_linenumber" name="680" href="#680">680</a>                     }
+<a class="jxr_linenumber" name="672" href="#672">672</a>         Context context = container.addWebapp( contextPath, baseDir );
+<a class="jxr_linenumber" name="673" href="#673">673</a> 
+<a class="jxr_linenumber" name="674" href="#674">674</a>         context.setResources(
+<a class="jxr_linenumber" name="675" href="#675">675</a>             <strong class="jxr_keyword">new</strong> <a href="../../../../../../../org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.html">MyDirContext</a>( <strong class="jxr_keyword">new</strong> File( project.getBuild().getOutputDirectory() ).getAbsolutePath() ) );
+<a class="jxr_linenumber" name="676" href="#676">676</a> 
+<a class="jxr_linenumber" name="677" href="#677">677</a>         <strong class="jxr_keyword">if</strong> ( useSeparateTomcatClassLoader )
+<a class="jxr_linenumber" name="678" href="#678">678</a>         {
+<a class="jxr_linenumber" name="679" href="#679">679</a>             context.setParentClassLoader( getTomcatClassLoader() );
+<a class="jxr_linenumber" name="680" href="#680">680</a>         }
 <a class="jxr_linenumber" name="681" href="#681">681</a> 
-<a class="jxr_linenumber" name="682" href="#682">682</a>                     String docBase = reader.getAttributeValue( <strong class="jxr_keyword">null</strong>, <span class="jxr_string">"docBase"</span> );
-<a class="jxr_linenumber" name="683" href="#683">683</a>                     <strong class="jxr_keyword">if</strong> ( StringUtils.isNotBlank( docBase ) )
-<a class="jxr_linenumber" name="684" href="#684">684</a>                     {
-<a class="jxr_linenumber" name="685" href="#685">685</a>                         standardContext.setDocBase( docBase );
-<a class="jxr_linenumber" name="686" href="#686">686</a>                     }
-<a class="jxr_linenumber" name="687" href="#687">687</a>                 }
-<a class="jxr_linenumber" name="688" href="#688">688</a>                 <strong class="jxr_keyword">if</strong> ( !reader.hasNext() )
-<a class="jxr_linenumber" name="689" href="#689">689</a>                 {
-<a class="jxr_linenumber" name="690" href="#690">690</a>                     <strong class="jxr_keyword">break</strong>;
-<a class="jxr_linenumber" name="691" href="#691">691</a>                 }
-<a class="jxr_linenumber" name="692" href="#692">692</a>                 tag = reader.next();
-<a class="jxr_linenumber" name="693" href="#693">693</a>             }
-<a class="jxr_linenumber" name="694" href="#694">694</a> 
-<a class="jxr_linenumber" name="695" href="#695">695</a>             <strong class="jxr_keyword">return</strong> standardContext;
+<a class="jxr_linenumber" name="682" href="#682">682</a>         <strong class="jxr_keyword">final</strong> WebappLoader loader = createWebappLoader();
+<a class="jxr_linenumber" name="683" href="#683">683</a> 
+<a class="jxr_linenumber" name="684" href="#684">684</a>         context.setLoader( loader );
+<a class="jxr_linenumber" name="685" href="#685">685</a> 
+<a class="jxr_linenumber" name="686" href="#686">686</a>         <strong class="jxr_keyword">if</strong> ( overriddenContextFile != <strong class="jxr_keyword">null</strong> )
+<a class="jxr_linenumber" name="687" href="#687">687</a>         {
+<a class="jxr_linenumber" name="688" href="#688">688</a>             <em class="jxr_comment">// here, send file to Tomcat for it to complain if missing</em>
+<a class="jxr_linenumber" name="689" href="#689">689</a>             context.setConfigFile( overriddenContextFile.toURI().toURL() );
+<a class="jxr_linenumber" name="690" href="#690">690</a>         }
+<a class="jxr_linenumber" name="691" href="#691">691</a>         <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> ( defaultContextFile.exists() )
+<a class="jxr_linenumber" name="692" href="#692">692</a>         {
+<a class="jxr_linenumber" name="693" href="#693">693</a>             <em class="jxr_comment">// here, only sending default file if it indeed exists</em>
+<a class="jxr_linenumber" name="694" href="#694">694</a>             <em class="jxr_comment">// otherwise Tomcat will create a default context</em>
+<a class="jxr_linenumber" name="695" href="#695">695</a>             context.setConfigFile( defaultContextFile.toURI().toURL() );
 <a class="jxr_linenumber" name="696" href="#696">696</a>         }
-<a class="jxr_linenumber" name="697" href="#697">697</a>         <strong class="jxr_keyword">catch</strong> ( XMLStreamException e )
-<a class="jxr_linenumber" name="698" href="#698">698</a>         {
-<a class="jxr_linenumber" name="699" href="#699">699</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( e.getMessage(), e );
-<a class="jxr_linenumber" name="700" href="#700">700</a>         }
-<a class="jxr_linenumber" name="701" href="#701">701</a>         <strong class="jxr_keyword">catch</strong> ( FileNotFoundException e )
-<a class="jxr_linenumber" name="702" href="#702">702</a>         {
-<a class="jxr_linenumber" name="703" href="#703">703</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( e.getMessage(), e );
-<a class="jxr_linenumber" name="704" href="#704">704</a>         }
-<a class="jxr_linenumber" name="705" href="#705">705</a>     }
-<a class="jxr_linenumber" name="706" href="#706">706</a> 
+<a class="jxr_linenumber" name="697" href="#697">697</a> 
+<a class="jxr_linenumber" name="698" href="#698">698</a>         <strong class="jxr_keyword">if</strong> ( classLoaderClass != <strong class="jxr_keyword">null</strong> )
+<a class="jxr_linenumber" name="699" href="#699">699</a>         {
+<a class="jxr_linenumber" name="700" href="#700">700</a>             loader.setLoaderClass( classLoaderClass );
+<a class="jxr_linenumber" name="701" href="#701">701</a>         }
+<a class="jxr_linenumber" name="702" href="#702">702</a> 
+<a class="jxr_linenumber" name="703" href="#703">703</a>         <em class="jxr_comment">// https://issues.apache.org/jira/browse/MTOMCAT-239</em>
+<a class="jxr_linenumber" name="704" href="#704">704</a>         <em class="jxr_comment">// get the jar scanner to configure scanning directories as we can run a jar or a reactor project with a jar so</em>
+<a class="jxr_linenumber" name="705" href="#705">705</a>         <em class="jxr_comment">// the entries is a directory (target/classes)</em>
+<a class="jxr_linenumber" name="706" href="#706">706</a>         JarScanner jarScanner = context.getJarScanner();
 <a class="jxr_linenumber" name="707" href="#707">707</a> 
-<a class="jxr_linenumber" name="708" href="#708">708</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../../../org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.html">MyDirContext</a>
-<a class="jxr_linenumber" name="709" href="#709">709</a>         <strong class="jxr_keyword">extends</strong> FileDirContext
-<a class="jxr_linenumber" name="710" href="#710">710</a>     {
-<a class="jxr_linenumber" name="711" href="#711">711</a>         String buildOutputDirectory;
-<a class="jxr_linenumber" name="712" href="#712">712</a> 
-<a class="jxr_linenumber" name="713" href="#713">713</a>         <a href="../../../../../../../org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.html">MyDirContext</a>( String buildOutputDirectory )
-<a class="jxr_linenumber" name="714" href="#714">714</a>         {
-<a class="jxr_linenumber" name="715" href="#715">715</a>             <strong class="jxr_keyword">this</strong>.buildOutputDirectory = buildOutputDirectory;
-<a class="jxr_linenumber" name="716" href="#716">716</a>         }
+<a class="jxr_linenumber" name="708" href="#708">708</a>         <em class="jxr_comment">// normally this one only but just in case ...</em>
+<a class="jxr_linenumber" name="709" href="#709">709</a>         <strong class="jxr_keyword">if</strong> ( jarScanner instanceof StandardJarScanner )
+<a class="jxr_linenumber" name="710" href="#710">710</a>         {
+<a class="jxr_linenumber" name="711" href="#711">711</a>             ( (StandardJarScanner) jarScanner ).setScanAllDirectories( jarScanAllDirectories );
+<a class="jxr_linenumber" name="712" href="#712">712</a>         }
+<a class="jxr_linenumber" name="713" href="#713">713</a> 
+<a class="jxr_linenumber" name="714" href="#714">714</a>         <strong class="jxr_keyword">return</strong> context;
+<a class="jxr_linenumber" name="715" href="#715">715</a> 
+<a class="jxr_linenumber" name="716" href="#716">716</a>     }
 <a class="jxr_linenumber" name="717" href="#717">717</a> 
-<a class="jxr_linenumber" name="718" href="#718">718</a>         @Override
-<a class="jxr_linenumber" name="719" href="#719">719</a>         <strong class="jxr_keyword">protected</strong> List&lt;NamingEntry&gt; doListBindings( String name )
-<a class="jxr_linenumber" name="720" href="#720">720</a>             <strong class="jxr_keyword">throws</strong> NamingException
-<a class="jxr_linenumber" name="721" href="#721">721</a>         {
-<a class="jxr_linenumber" name="722" href="#722">722</a>             <strong class="jxr_keyword">if</strong> ( <span class="jxr_string">"/WEB-INF/classes"</span>.equals( name ) )
-<a class="jxr_linenumber" name="723" href="#723">723</a>             {
-<a class="jxr_linenumber" name="724" href="#724">724</a>                 <strong class="jxr_keyword">if</strong> ( !<strong class="jxr_keyword">new</strong> File( buildOutputDirectory ).exists() )
-<a class="jxr_linenumber" name="725" href="#725">725</a>                 {
-<a class="jxr_linenumber" name="726" href="#726">726</a>                     <strong class="jxr_keyword">return</strong> Collections.emptyList();
-<a class="jxr_linenumber" name="727" href="#727">727</a>                 }
-<a class="jxr_linenumber" name="728" href="#728">728</a>                 FileDirContext fileDirContext = <strong class="jxr_keyword">new</strong> FileDirContext();
-<a class="jxr_linenumber" name="729" href="#729">729</a>                 fileDirContext.setDocBase( buildOutputDirectory );
-<a class="jxr_linenumber" name="730" href="#730">730</a>                 NamingEntry namingEntry = <strong class="jxr_keyword">new</strong> NamingEntry( <span class="jxr_string">"/WEB-INF/classes"</span>, fileDirContext, -1 );
-<a class="jxr_linenumber" name="731" href="#731">731</a>                 <strong class="jxr_keyword">return</strong> Collections.singletonList( namingEntry );
-<a class="jxr_linenumber" name="732" href="#732">732</a>             }
-<a class="jxr_linenumber" name="733" href="#733">733</a> 
-<a class="jxr_linenumber" name="734" href="#734">734</a>             <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">super</strong>.doListBindings( name );
-<a class="jxr_linenumber" name="735" href="#735">735</a>         }
-<a class="jxr_linenumber" name="736" href="#736">736</a>     }
+<a class="jxr_linenumber" name="718" href="#718">718</a>     <strong class="jxr_keyword">protected</strong> StandardContext parseContextFile( File file )
+<a class="jxr_linenumber" name="719" href="#719">719</a>         <strong class="jxr_keyword">throws</strong> MojoExecutionException
+<a class="jxr_linenumber" name="720" href="#720">720</a>     {
+<a class="jxr_linenumber" name="721" href="#721">721</a>         <strong class="jxr_keyword">try</strong>
+<a class="jxr_linenumber" name="722" href="#722">722</a>         {
+<a class="jxr_linenumber" name="723" href="#723">723</a>             StandardContext standardContext = <strong class="jxr_keyword">new</strong> StandardContext();
+<a class="jxr_linenumber" name="724" href="#724">724</a>             XMLStreamReader reader = XMLInputFactory.newFactory().createXMLStreamReader( <strong class="jxr_keyword">new</strong> FileInputStream( file ) );
+<a class="jxr_linenumber" name="725" href="#725">725</a> 
+<a class="jxr_linenumber" name="726" href="#726">726</a>             <strong class="jxr_keyword">int</strong> tag = reader.next();
+<a class="jxr_linenumber" name="727" href="#727">727</a> 
+<a class="jxr_linenumber" name="728" href="#728">728</a>             <strong class="jxr_keyword">while</strong> ( <strong class="jxr_keyword">true</strong> )
+<a class="jxr_linenumber" name="729" href="#729">729</a>             {
+<a class="jxr_linenumber" name="730" href="#730">730</a>                 <strong class="jxr_keyword">if</strong> ( tag == XMLStreamConstants.START_ELEMENT &amp;&amp; StringUtils.equals( <span class="jxr_string">"Context"</span>, reader.getLocalName() ) )
+<a class="jxr_linenumber" name="731" href="#731">731</a>                 {
+<a class="jxr_linenumber" name="732" href="#732">732</a>                     String path = reader.getAttributeValue( <strong class="jxr_keyword">null</strong>, <span class="jxr_string">"path"</span> );
+<a class="jxr_linenumber" name="733" href="#733">733</a>                     <strong class="jxr_keyword">if</strong> ( StringUtils.isNotBlank( path ) )
+<a class="jxr_linenumber" name="734" href="#734">734</a>                     {
+<a class="jxr_linenumber" name="735" href="#735">735</a>                         standardContext.setPath( path );
+<a class="jxr_linenumber" name="736" href="#736">736</a>                     }
 <a class="jxr_linenumber" name="737" href="#737">737</a> 
-<a class="jxr_linenumber" name="738" href="#738">738</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="739" href="#739">739</a> <em class="jxr_javadoccomment">     * Gets the webapp loader to run this web application under.</em>
-<a class="jxr_linenumber" name="740" href="#740">740</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="741" href="#741">741</a> <em class="jxr_javadoccomment">     * @return the webapp loader to use</em>
-<a class="jxr_linenumber" name="742" href="#742">742</a> <em class="jxr_javadoccomment">     * @throws IOException            if the webapp loader could not be created</em>
-<a class="jxr_linenumber" name="743" href="#743">743</a> <em class="jxr_javadoccomment">     * @throws MojoExecutionException in case of an error creating the webapp loader</em>
-<a class="jxr_linenumber" name="744" href="#744">744</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="745" href="#745">745</a>     <strong class="jxr_keyword">protected</strong> WebappLoader createWebappLoader()
-<a class="jxr_linenumber" name="746" href="#746">746</a>         <strong class="jxr_keyword">throws</strong> IOException, MojoExecutionException
-<a class="jxr_linenumber" name="747" href="#747">747</a>     {
-<a class="jxr_linenumber" name="748" href="#748">748</a>         <strong class="jxr_keyword">if</strong> ( useSeparateTomcatClassLoader )
-<a class="jxr_linenumber" name="749" href="#749">749</a>         {
-<a class="jxr_linenumber" name="750" href="#750">750</a>             <strong class="jxr_keyword">return</strong> ( isContextReloadable() )
-<a class="jxr_linenumber" name="751" href="#751">751</a>                 ? <strong class="jxr_keyword">new</strong> ExternalRepositoriesReloadableWebappLoader( getTomcatClassLoader(), getLog() )
-<a class="jxr_linenumber" name="752" href="#752">752</a>                 : <strong class="jxr_keyword">new</strong> WebappLoader( getTomcatClassLoader() );
-<a class="jxr_linenumber" name="753" href="#753">753</a>         }
-<a class="jxr_linenumber" name="754" href="#754">754</a> 
-<a class="jxr_linenumber" name="755" href="#755">755</a>         <strong class="jxr_keyword">return</strong> ( isContextReloadable() )
-<a class="jxr_linenumber" name="756" href="#756">756</a>             ? <strong class="jxr_keyword">new</strong> ExternalRepositoriesReloadableWebappLoader( Thread.currentThread().getContextClassLoader(), getLog() )
-<a class="jxr_linenumber" name="757" href="#757">757</a>             : <strong class="jxr_keyword">new</strong> WebappLoader( Thread.currentThread().getContextClassLoader() );
-<a class="jxr_linenumber" name="758" href="#758">758</a>     }
-<a class="jxr_linenumber" name="759" href="#759">759</a> 
-<a class="jxr_linenumber" name="760" href="#760">760</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="761" href="#761">761</a> <em class="jxr_javadoccomment">     * Determine whether the passed context.xml file declares the context as reloadable or not.</em>
-<a class="jxr_linenumber" name="762" href="#762">762</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="763" href="#763">763</a> <em class="jxr_javadoccomment">     * @return false by default, true if  reloadable="true" in context.xml.</em>
-<a class="jxr_linenumber" name="764" href="#764">764</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="765" href="#765">765</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">boolean</strong> isContextReloadable()
-<a class="jxr_linenumber" name="766" href="#766">766</a>         <strong class="jxr_keyword">throws</strong> MojoExecutionException
-<a class="jxr_linenumber" name="767" href="#767">767</a>     {
-<a class="jxr_linenumber" name="768" href="#768">768</a>         <strong class="jxr_keyword">if</strong> ( contextReloadable || backgroundProcessorDelay &gt; 0 )
-<a class="jxr_linenumber" name="769" href="#769">769</a>         {
-<a class="jxr_linenumber" name="770" href="#770">770</a>             <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;
-<a class="jxr_linenumber" name="771" href="#771">771</a>         }
-<a class="jxr_linenumber" name="772" href="#772">772</a>         <em class="jxr_comment">// determine whether to use a reloadable Loader or not (default is false).</em>
-<a class="jxr_linenumber" name="773" href="#773">773</a>         <strong class="jxr_keyword">boolean</strong> reloadable = false;
-<a class="jxr_linenumber" name="774" href="#774">774</a>         <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="775" href="#775">775</a>         {
-<a class="jxr_linenumber" name="776" href="#776">776</a>             <strong class="jxr_keyword">if</strong> ( contextFile != <strong class="jxr_keyword">null</strong> &amp;&amp; contextFile.exists() )
-<a class="jxr_linenumber" name="777" href="#777">777</a>             {
-<a class="jxr_linenumber" name="778" href="#778">778</a>                 DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
-<a class="jxr_linenumber" name="779" href="#779">779</a>                 DocumentBuilder builder = builderFactory.newDocumentBuilder();
-<a class="jxr_linenumber" name="780" href="#780">780</a>                 Document contextDoc = builder.parse( contextFile );
-<a class="jxr_linenumber" name="781" href="#781">781</a>                 contextDoc.getDocumentElement().normalize();
-<a class="jxr_linenumber" name="782" href="#782">782</a> 
-<a class="jxr_linenumber" name="783" href="#783">783</a>                 NamedNodeMap nodeMap = contextDoc.getDocumentElement().getAttributes();
-<a class="jxr_linenumber" name="784" href="#784">784</a>                 Node reloadableAttribute = nodeMap.getNamedItem( <span class="jxr_string">"reloadable"</span> );
-<a class="jxr_linenumber" name="785" href="#785">785</a> 
-<a class="jxr_linenumber" name="786" href="#786">786</a>                 reloadable =
-<a class="jxr_linenumber" name="787" href="#787">787</a>                     ( reloadableAttribute != <strong class="jxr_keyword">null</strong> ) ? Boolean.valueOf( reloadableAttribute.getNodeValue() ) : false;
+<a class="jxr_linenumber" name="738" href="#738">738</a>                     String docBase = reader.getAttributeValue( <strong class="jxr_keyword">null</strong>, <span class="jxr_string">"docBase"</span> );
+<a class="jxr_linenumber" name="739" href="#739">739</a>                     <strong class="jxr_keyword">if</strong> ( StringUtils.isNotBlank( docBase ) )
+<a class="jxr_linenumber" name="740" href="#740">740</a>                     {
+<a class="jxr_linenumber" name="741" href="#741">741</a>                         standardContext.setDocBase( docBase );
+<a class="jxr_linenumber" name="742" href="#742">742</a>                     }
+<a class="jxr_linenumber" name="743" href="#743">743</a>                 }
+<a class="jxr_linenumber" name="744" href="#744">744</a>                 <strong class="jxr_keyword">if</strong> ( !reader.hasNext() )
+<a class="jxr_linenumber" name="745" href="#745">745</a>                 {
+<a class="jxr_linenumber" name="746" href="#746">746</a>                     <strong class="jxr_keyword">break</strong>;
+<a class="jxr_linenumber" name="747" href="#747">747</a>                 }
+<a class="jxr_linenumber" name="748" href="#748">748</a>                 tag = reader.next();
+<a class="jxr_linenumber" name="749" href="#749">749</a>             }
+<a class="jxr_linenumber" name="750" href="#750">750</a> 
+<a class="jxr_linenumber" name="751" href="#751">751</a>             <strong class="jxr_keyword">return</strong> standardContext;
+<a class="jxr_linenumber" name="752" href="#752">752</a>         }
+<a class="jxr_linenumber" name="753" href="#753">753</a>         <strong class="jxr_keyword">catch</strong> ( XMLStreamException e )
+<a class="jxr_linenumber" name="754" href="#754">754</a>         {
+<a class="jxr_linenumber" name="755" href="#755">755</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( e.getMessage(), e );
+<a class="jxr_linenumber" name="756" href="#756">756</a>         }
+<a class="jxr_linenumber" name="757" href="#757">757</a>         <strong class="jxr_keyword">catch</strong> ( FileNotFoundException e )
+<a class="jxr_linenumber" name="758" href="#758">758</a>         {
+<a class="jxr_linenumber" name="759" href="#759">759</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( e.getMessage(), e );
+<a class="jxr_linenumber" name="760" href="#760">760</a>         }
+<a class="jxr_linenumber" name="761" href="#761">761</a>     }
+<a class="jxr_linenumber" name="762" href="#762">762</a> 
+<a class="jxr_linenumber" name="763" href="#763">763</a> 
+<a class="jxr_linenumber" name="764" href="#764">764</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../../../org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.html">MyDirContext</a>
+<a class="jxr_linenumber" name="765" href="#765">765</a>         <strong class="jxr_keyword">extends</strong> FileDirContext
+<a class="jxr_linenumber" name="766" href="#766">766</a>     {
+<a class="jxr_linenumber" name="767" href="#767">767</a>         String buildOutputDirectory;
+<a class="jxr_linenumber" name="768" href="#768">768</a> 
+<a class="jxr_linenumber" name="769" href="#769">769</a>         <a href="../../../../../../../org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.html">MyDirContext</a>( String buildOutputDirectory )
+<a class="jxr_linenumber" name="770" href="#770">770</a>         {
+<a class="jxr_linenumber" name="771" href="#771">771</a>             <strong class="jxr_keyword">this</strong>.buildOutputDirectory = buildOutputDirectory;
+<a class="jxr_linenumber" name="772" href="#772">772</a>         }
+<a class="jxr_linenumber" name="773" href="#773">773</a> 
+<a class="jxr_linenumber" name="774" href="#774">774</a>         @Override
+<a class="jxr_linenumber" name="775" href="#775">775</a>         <strong class="jxr_keyword">protected</strong> List&lt;NamingEntry&gt; doListBindings( String name )
+<a class="jxr_linenumber" name="776" href="#776">776</a>             <strong class="jxr_keyword">throws</strong> NamingException
+<a class="jxr_linenumber" name="777" href="#777">777</a>         {
+<a class="jxr_linenumber" name="778" href="#778">778</a>             <strong class="jxr_keyword">if</strong> ( <span class="jxr_string">"/WEB-INF/classes"</span>.equals( name ) )
+<a class="jxr_linenumber" name="779" href="#779">779</a>             {
+<a class="jxr_linenumber" name="780" href="#780">780</a>                 <strong class="jxr_keyword">if</strong> ( !<strong class="jxr_keyword">new</strong> File( buildOutputDirectory ).exists() )
+<a class="jxr_linenumber" name="781" href="#781">781</a>                 {
+<a class="jxr_linenumber" name="782" href="#782">782</a>                     <strong class="jxr_keyword">return</strong> Collections.emptyList();
+<a class="jxr_linenumber" name="783" href="#783">783</a>                 }
+<a class="jxr_linenumber" name="784" href="#784">784</a>                 FileDirContext fileDirContext = <strong class="jxr_keyword">new</strong> FileDirContext();
+<a class="jxr_linenumber" name="785" href="#785">785</a>                 fileDirContext.setDocBase( buildOutputDirectory );
+<a class="jxr_linenumber" name="786" href="#786">786</a>                 NamingEntry namingEntry = <strong class="jxr_keyword">new</strong> NamingEntry( <span class="jxr_string">"/WEB-INF/classes"</span>, fileDirContext, -1 );
+<a class="jxr_linenumber" name="787" href="#787">787</a>                 <strong class="jxr_keyword">return</strong> Collections.singletonList( namingEntry );
 <a class="jxr_linenumber" name="788" href="#788">788</a>             }
-<a class="jxr_linenumber" name="789" href="#789">789</a>             getLog().debug( <span class="jxr_string">"context reloadable: "</span> + reloadable );
-<a class="jxr_linenumber" name="790" href="#790">790</a>         }
-<a class="jxr_linenumber" name="791" href="#791">791</a>         <strong class="jxr_keyword">catch</strong> ( IOException ioe )
-<a class="jxr_linenumber" name="792" href="#792">792</a>         {
-<a class="jxr_linenumber" name="793" href="#793">793</a>             getLog().error( <span class="jxr_string">"Could not parse file: ["</span> + contextFile.getAbsolutePath() + <span class="jxr_string">"]"</span>, ioe );
-<a class="jxr_linenumber" name="794" href="#794">794</a>         }
-<a class="jxr_linenumber" name="795" href="#795">795</a>         <strong class="jxr_keyword">catch</strong> ( ParserConfigurationException pce )
-<a class="jxr_linenumber" name="796" href="#796">796</a>         {
-<a class="jxr_linenumber" name="797" href="#797">797</a>             getLog().error( <span class="jxr_string">"Could not configure XML parser"</span>, pce );
-<a class="jxr_linenumber" name="798" href="#798">798</a>         }
-<a class="jxr_linenumber" name="799" href="#799">799</a>         <strong class="jxr_keyword">catch</strong> ( SAXException se )
-<a class="jxr_linenumber" name="800" href="#800">800</a>         {
-<a class="jxr_linenumber" name="801" href="#801">801</a>             getLog().error( <span class="jxr_string">"Could not parse file: ["</span> + contextFile.getAbsolutePath() + <span class="jxr_string">"]"</span>, se );
-<a class="jxr_linenumber" name="802" href="#802">802</a>         }
-<a class="jxr_linenumber" name="803" href="#803">803</a> 
-<a class="jxr_linenumber" name="804" href="#804">804</a>         <strong class="jxr_keyword">return</strong> reloadable;
-<a class="jxr_linenumber" name="805" href="#805">805</a>     }
-<a class="jxr_linenumber" name="806" href="#806">806</a> 
-<a class="jxr_linenumber" name="807" href="#807">807</a> 
-<a class="jxr_linenumber" name="808" href="#808">808</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="809" href="#809">809</a> <em class="jxr_javadoccomment">     * Gets the webapp directory to run.</em>
-<a class="jxr_linenumber" name="810" href="#810">810</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="811" href="#811">811</a> <em class="jxr_javadoccomment">     * @return the webapp directory</em>
-<a class="jxr_linenumber" name="812" href="#812">812</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="813" href="#813">813</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">abstract</strong> File getDocBase()
-<a class="jxr_linenumber" name="814" href="#814">814</a>         <strong class="jxr_keyword">throws</strong> IOException;
+<a class="jxr_linenumber" name="789" href="#789">789</a> 
+<a class="jxr_linenumber" name="790" href="#790">790</a>             <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">super</strong>.doListBindings( name );
+<a class="jxr_linenumber" name="791" href="#791">791</a>         }
+<a class="jxr_linenumber" name="792" href="#792">792</a>     }
+<a class="jxr_linenumber" name="793" href="#793">793</a> 
+<a class="jxr_linenumber" name="794" href="#794">794</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="795" href="#795">795</a> <em class="jxr_javadoccomment">     * Gets the webapp loader to run this web application under.</em>
+<a class="jxr_linenumber" name="796" href="#796">796</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="797" href="#797">797</a> <em class="jxr_javadoccomment">     * @return the webapp loader to use</em>
+<a class="jxr_linenumber" name="798" href="#798">798</a> <em class="jxr_javadoccomment">     * @throws IOException            if the webapp loader could not be created</em>
+<a class="jxr_linenumber" name="799" href="#799">799</a> <em class="jxr_javadoccomment">     * @throws MojoExecutionException in case of an error creating the webapp loader</em>
+<a class="jxr_linenumber" name="800" href="#800">800</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="801" href="#801">801</a>     <strong class="jxr_keyword">protected</strong> WebappLoader createWebappLoader()
+<a class="jxr_linenumber" name="802" href="#802">802</a>         <strong class="jxr_keyword">throws</strong> IOException, MojoExecutionException
+<a class="jxr_linenumber" name="803" href="#803">803</a>     {
+<a class="jxr_linenumber" name="804" href="#804">804</a>         <strong class="jxr_keyword">if</strong> ( useSeparateTomcatClassLoader )
+<a class="jxr_linenumber" name="805" href="#805">805</a>         {
+<a class="jxr_linenumber" name="806" href="#806">806</a>             <strong class="jxr_keyword">return</strong> ( isContextReloadable() )
+<a class="jxr_linenumber" name="807" href="#807">807</a>                 ? <strong class="jxr_keyword">new</strong> ExternalRepositoriesReloadableWebappLoader( getTomcatClassLoader(), getLog() )
+<a class="jxr_linenumber" name="808" href="#808">808</a>                 : <strong class="jxr_keyword">new</strong> WebappLoader( getTomcatClassLoader() );
+<a class="jxr_linenumber" name="809" href="#809">809</a>         }
+<a class="jxr_linenumber" name="810" href="#810">810</a> 
+<a class="jxr_linenumber" name="811" href="#811">811</a>         <strong class="jxr_keyword">return</strong> ( isContextReloadable() )
+<a class="jxr_linenumber" name="812" href="#812">812</a>             ? <strong class="jxr_keyword">new</strong> ExternalRepositoriesReloadableWebappLoader( Thread.currentThread().getContextClassLoader(), getLog() )
+<a class="jxr_linenumber" name="813" href="#813">813</a>             : <strong class="jxr_keyword">new</strong> WebappLoader( Thread.currentThread().getContextClassLoader() );
+<a class="jxr_linenumber" name="814" href="#814">814</a>     }
 <a class="jxr_linenumber" name="815" href="#815">815</a> 
 <a class="jxr_linenumber" name="816" href="#816">816</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="817" href="#817">817</a> <em class="jxr_javadoccomment">     * Gets the Tomcat context XML file to use.</em>
+<a class="jxr_linenumber" name="817" href="#817">817</a> <em class="jxr_javadoccomment">     * Determine whether the passed context.xml file declares the context as reloadable or not.</em>
 <a class="jxr_linenumber" name="818" href="#818">818</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="819" href="#819">819</a> <em class="jxr_javadoccomment">     * @return the context XML file</em>
+<a class="jxr_linenumber" name="819" href="#819">819</a> <em class="jxr_javadoccomment">     * @return false by default, true if  reloadable="true" in context.xml.</em>
 <a class="jxr_linenumber" name="820" href="#820">820</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="821" href="#821">821</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">abstract</strong> File getContextFile()
-<a class="jxr_linenumber" name="822" href="#822">822</a>         <strong class="jxr_keyword">throws</strong> MojoExecutionException;
-<a class="jxr_linenumber" name="823" href="#823">823</a> 
-<a class="jxr_linenumber" name="824" href="#824">824</a>     <em class="jxr_comment">// ----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="825" href="#825">825</a>     <em class="jxr_comment">// Private Methods</em>
-<a class="jxr_linenumber" name="826" href="#826">826</a>     <em class="jxr_comment">// ----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="827" href="#827">827</a> 
-<a class="jxr_linenumber" name="828" href="#828">828</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="829" href="#829">829</a> <em class="jxr_javadoccomment">     * Gets whether this project uses WAR packaging.</em>
-<a class="jxr_linenumber" name="830" href="#830">830</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="831" href="#831">831</a> <em class="jxr_javadoccomment">     * @return whether this project uses WAR packaging</em>
-<a class="jxr_linenumber" name="832" href="#832">832</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="833" href="#833">833</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">boolean</strong> isWar()
-<a class="jxr_linenumber" name="834" href="#834">834</a>     {
-<a class="jxr_linenumber" name="835" href="#835">835</a>         <strong class="jxr_keyword">return</strong> <span class="jxr_string">"war"</span>.equals( packaging ) || ignorePackaging;
-<a class="jxr_linenumber" name="836" href="#836">836</a>     }
-<a class="jxr_linenumber" name="837" href="#837">837</a> 
-<a class="jxr_linenumber" name="838" href="#838">838</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="839" href="#839">839</a> <em class="jxr_javadoccomment">     * Gets the URL of the running webapp.</em>
-<a class="jxr_linenumber" name="840" href="#840">840</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="841" href="#841">841</a> <em class="jxr_javadoccomment">     * @return the URL of the running webapp</em>
-<a class="jxr_linenumber" name="842" href="#842">842</a> <em class="jxr_javadoccomment">     * @throws java.net.MalformedURLException if the running webapp URL is invalid</em>
-<a class="jxr_linenumber" name="843" href="#843">843</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="844" href="#844">844</a>     <strong class="jxr_keyword">private</strong> URL getWebappUrl()
-<a class="jxr_linenumber" name="845" href="#845">845</a>         <strong class="jxr_keyword">throws</strong> MalformedURLException
-<a class="jxr_linenumber" name="846" href="#846">846</a>     {
-<a class="jxr_linenumber" name="847" href="#847">847</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> URL( <span class="jxr_string">"http"</span>, <span class="jxr_string">"localhost"</span>, port, getPath() );
-<a class="jxr_linenumber" name="848" href="#848">848</a>     }
-<a class="jxr_linenumber" name="849" href="#849">849</a> 
-<a class="jxr_linenumber" name="850" href="#850">850</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="851" href="#851">851</a> <em class="jxr_javadoccomment">     * FIXME not sure we need all of those files with tomcat7</em>
-<a class="jxr_linenumber" name="852" href="#852">852</a> <em class="jxr_javadoccomment">     * Creates the Tomcat configuration directory with the necessary resources.</em>
-<a class="jxr_linenumber" name="853" href="#853">853</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="854" href="#854">854</a> <em class="jxr_javadoccomment">     * @throws IOException            if the Tomcat configuration could not be created</em>
-<a class="jxr_linenumber" name="855" href="#855">855</a> <em class="jxr_javadoccomment">     * @throws MojoExecutionException if the Tomcat configuration could not be created</em>
-<a class="jxr_linenumber" name="856" href="#856">856</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="857" href="#857">857</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> initConfiguration()
-<a class="jxr_linenumber" name="858" href="#858">858</a>         <strong class="jxr_keyword">throws</strong> IOException, MojoExecutionException, MavenFilteringException
-<a class="jxr_linenumber" name="859" href="#859">859</a>     {
-<a class="jxr_linenumber" name="860" href="#860">860</a>         <strong class="jxr_keyword">if</strong> ( configurationDir.exists() )
-<a class="jxr_linenumber" name="861" href="#861">861</a>         {
-<a class="jxr_linenumber" name="862" href="#862">862</a>             getLog().info( messagesProvider.getMessage( <span class="jxr_string">"AbstractRunMojo.usingConfiguration"</span>, configurationDir ) );
-<a class="jxr_linenumber" name="863" href="#863">863</a>         }
-<a class="jxr_linenumber" name="864" href="#864">864</a>         <strong class="jxr_keyword">else</strong>
-<a class="jxr_linenumber" name="865" href="#865">865</a>         {
-<a class="jxr_linenumber" name="866" href="#866">866</a>             getLog().info( messagesProvider.getMessage( <span class="jxr_string">"AbstractRunMojo.creatingConfiguration"</span>, configurationDir ) );
-<a class="jxr_linenumber" name="867" href="#867">867</a> 
-<a class="jxr_linenumber" name="868" href="#868">868</a>             configurationDir.mkdirs();
-<a class="jxr_linenumber" name="869" href="#869">869</a> 
-<a class="jxr_linenumber" name="870" href="#870">870</a>             File confDir = <strong class="jxr_keyword">new</strong> File( configurationDir, <span class="jxr_string">"conf"</span> );
-<a class="jxr_linenumber" name="871" href="#871">871</a>             confDir.mkdir();
-<a class="jxr_linenumber" name="872" href="#872">872</a> 
-<a class="jxr_linenumber" name="873" href="#873">873</a>             <strong class="jxr_keyword">if</strong> ( tomcatLoggingFile != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="874" href="#874">874</a>             {
-<a class="jxr_linenumber" name="875" href="#875">875</a>                 FileUtils.copyFile( tomcatLoggingFile, <strong class="jxr_keyword">new</strong> File( confDir, <span class="jxr_string">"logging.properties"</span> ) );
-<a class="jxr_linenumber" name="876" href="#876">876</a>             }
-<a class="jxr_linenumber" name="877" href="#877">877</a>             <strong class="jxr_keyword">else</strong>
-<a class="jxr_linenumber" name="878" href="#878">878</a>             {
-<a class="jxr_linenumber" name="879" href="#879">879</a>                 copyFile( <span class="jxr_string">"/conf/logging.properties"</span>, <strong class="jxr_keyword">new</strong> File( confDir, <span class="jxr_string">"logging.properties"</span> ) );
-<a class="jxr_linenumber" name="880" href="#880">880</a>             }
-<a class="jxr_linenumber" name="881" href="#881">881</a> 
-<a class="jxr_linenumber" name="882" href="#882">882</a>             copyFile( <span class="jxr_string">"/conf/tomcat-users.xml"</span>, <strong class="jxr_keyword">new</strong> File( confDir, <span class="jxr_string">"tomcat-users.xml"</span> ) );
-<a class="jxr_linenumber" name="883" href="#883">883</a>             <strong class="jxr_keyword">if</strong> ( tomcatWebXml != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="884" href="#884">884</a>             {
-<a class="jxr_linenumber" name="885" href="#885">885</a>                 <strong class="jxr_keyword">if</strong> ( !tomcatWebXml.exists() )
-<a class="jxr_linenumber" name="886" href="#886">886</a>                 {
-<a class="jxr_linenumber" name="887" href="#887">887</a>                     <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( <span class="jxr_string">" tomcatWebXml "</span> + tomcatWebXml.getPath() + <span class="jxr_string">" not exists"</span> );
-<a class="jxr_linenumber" name="888" href="#888">888</a>                 }
-<a class="jxr_linenumber" name="889" href="#889">889</a>                 <em class="jxr_comment">//MTOMCAT-42  here it's a real file resources not a one coming with the mojo</em>
-<a class="jxr_linenumber" name="890" href="#890">890</a>                 <em class="jxr_comment">//MTOMCAT-128 apply filtering</em>
-<a class="jxr_linenumber" name="891" href="#891">891</a>                 MavenFileFilterRequest mavenFileFilterRequest = <strong class="jxr_keyword">new</strong> MavenFileFilterRequest();
-<a class="jxr_linenumber" name="892" href="#892">892</a>                 mavenFileFilterRequest.setFrom( tomcatWebXml );
-<a class="jxr_linenumber" name="893" href="#893">893</a>                 mavenFileFilterRequest.setTo( <strong class="jxr_keyword">new</strong> File( confDir, <span class="jxr_string">"web.xml"</span> ) );
-<a class="jxr_linenumber" name="894" href="#894">894</a>                 mavenFileFilterRequest.setMavenProject( project );
-<a class="jxr_linenumber" name="895" href="#895">895</a>                 mavenFileFilterRequest.setMavenSession( session );
-<a class="jxr_linenumber" name="896" href="#896">896</a>                 mavenFileFilterRequest.setFiltering( <strong class="jxr_keyword">true</strong> );
-<a class="jxr_linenumber" name="897" href="#897">897</a> 
-<a class="jxr_linenumber" name="898" href="#898">898</a>                 mavenFileFilter.copyFile( mavenFileFilterRequest );
-<a class="jxr_linenumber" name="899" href="#899">899</a> 
-<a class="jxr_linenumber" name="900" href="#900">900</a>             }
-<a class="jxr_linenumber" name="901" href="#901">901</a>             <strong class="jxr_keyword">else</strong>
-<a class="jxr_linenumber" name="902" href="#902">902</a>             {
-<a class="jxr_linenumber" name="903" href="#903">903</a>                 copyFile( <span class="jxr_string">"/conf/web.xml"</span>, <strong class="jxr_keyword">new</strong> File( confDir, <span class="jxr_string">"web.xml"</span> ) );
-<a class="jxr_linenumber" name="904" href="#904">904</a>             }
+<a class="jxr_linenumber" name="821" href="#821">821</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">boolean</strong> isContextReloadable()
+<a class="jxr_linenumber" name="822" href="#822">822</a>         <strong class="jxr_keyword">throws</strong> MojoExecutionException
+<a class="jxr_linenumber" name="823" href="#823">823</a>     {
+<a class="jxr_linenumber" name="824" href="#824">824</a>         <strong class="jxr_keyword">if</strong> ( contextReloadable || backgroundProcessorDelay &gt; 0 )
+<a class="jxr_linenumber" name="825" href="#825">825</a>         {
+<a class="jxr_linenumber" name="826" href="#826">826</a>             <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;
+<a class="jxr_linenumber" name="827" href="#827">827</a>         }
+<a class="jxr_linenumber" name="828" href="#828">828</a>         <em class="jxr_comment">// determine whether to use a reloadable Loader or not (default is false).</em>
+<a class="jxr_linenumber" name="829" href="#829">829</a>         <strong class="jxr_keyword">boolean</strong> reloadable = false;
+<a class="jxr_linenumber" name="830" href="#830">830</a>         <strong class="jxr_keyword">try</strong>
+<a class="jxr_linenumber" name="831" href="#831">831</a>         {
+<a class="jxr_linenumber" name="832" href="#832">832</a>             <strong class="jxr_keyword">if</strong> ( contextFile != <strong class="jxr_keyword">null</strong> &amp;&amp; contextFile.exists() )
+<a class="jxr_linenumber" name="833" href="#833">833</a>             {
+<a class="jxr_linenumber" name="834" href="#834">834</a>                 DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
+<a class="jxr_linenumber" name="835" href="#835">835</a>                 DocumentBuilder builder = builderFactory.newDocumentBuilder();
+<a class="jxr_linenumber" name="836" href="#836">836</a>                 Document contextDoc = builder.parse( contextFile );
+<a class="jxr_linenumber" name="837" href="#837">837</a>                 contextDoc.getDocumentElement().normalize();
+<a class="jxr_linenumber" name="838" href="#838">838</a> 
+<a class="jxr_linenumber" name="839" href="#839">839</a>                 NamedNodeMap nodeMap = contextDoc.getDocumentElement().getAttributes();
+<a class="jxr_linenumber" name="840" href="#840">840</a>                 Node reloadableAttribute = nodeMap.getNamedItem( <span class="jxr_string">"reloadable"</span> );
+<a class="jxr_linenumber" name="841" href="#841">841</a> 
+<a class="jxr_linenumber" name="842" href="#842">842</a>                 reloadable =
+<a class="jxr_linenumber" name="843" href="#843">843</a>                     ( reloadableAttribute != <strong class="jxr_keyword">null</strong> ) ? Boolean.valueOf( reloadableAttribute.getNodeValue() ) : false;
+<a class="jxr_linenumber" name="844" href="#844">844</a>             }
+<a class="jxr_linenumber" name="845" href="#845">845</a>             getLog().debug( <span class="jxr_string">"context reloadable: "</span> + reloadable );
+<a class="jxr_linenumber" name="846" href="#846">846</a>         }
+<a class="jxr_linenumber" name="847" href="#847">847</a>         <strong class="jxr_keyword">catch</strong> ( IOException ioe )
+<a class="jxr_linenumber" name="848" href="#848">848</a>         {
+<a class="jxr_linenumber" name="849" href="#849">849</a>             getLog().error( <span class="jxr_string">"Could not parse file: ["</span> + contextFile.getAbsolutePath() + <span class="jxr_string">"]"</span>, ioe );
+<a class="jxr_linenumber" name="850" href="#850">850</a>         }
+<a class="jxr_linenumber" name="851" href="#851">851</a>         <strong class="jxr_keyword">catch</strong> ( ParserConfigurationException pce )
+<a class="jxr_linenumber" name="852" href="#852">852</a>         {

[... 1198 lines stripped ...]


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message