tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arne Franken (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (MTOMCAT-187) Scan resources executing run goal
Date Wed, 05 Dec 2012 10:54:58 GMT

    [ https://issues.apache.org/jira/browse/MTOMCAT-187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13510416#comment-13510416
] 

Arne Franken edited comment on MTOMCAT-187 at 12/5/12 10:53 AM:
----------------------------------------------------------------

If you spread your resources across multiple maven modules, you could configure a context.xml
in the plugin configuration:

{quote}
<plugin>
  <groupId>org.apache.tomcat.maven</groupId>
  <artifactId>tomcat7-maven-plugin</artifactId>
  <version>2.0</version>
  <configuration>
    <contextFile>${project.basedir}/src/main/path/to/tomcat-context.xml</contextFile>
  </configuration>
</plugin>
{quote}

and then add directories that the tomcat should scan to that file:

{quote}
<?xml version="1.0" encoding="ISO-8859-1"?>
<Context>
  <!--
    value for Resources#extraResourcePaths MUST NOT contain any separating character other
than a "," and MUST be ended after the
     last character by a " directly !!!

    this will work: extraResourcePaths="/=a,/=b"
    this will NOT work: extraResourcePaths="/=a,/=b "
    this will NOT work: extraResourcePaths="/=a, /=b"
  -->
  <Resources className="org.apache.naming.resources.VirtualDirContext"
      extraResourcePaths="/=${project.basedir}/src/main/webapp,/=${project.basedir}/../my-other-module/src/main/resources/META-INF/resources"
/>
</Context>
{quote}
                
      was (Author: arnefranken):
    If you spread your resources across multiple maven modules, you could configure a context.xml
in the plugin configuration:

{code}
<plugin>
  <groupId>org.apache.tomcat.maven</groupId>
  <artifactId>tomcat7-maven-plugin</artifactId>
  <version>2.0</version>
  <configuration>
    <contextFile>${project.basedir}/src/main/path/to/tomcat-context.xml</contextFile>
  </configuration>
</plugin>
{code}

and then add directories that the tomcat should scan to that file:

{code}
<?xml version="1.0" encoding="ISO-8859-1"?>
<Context>
  <!--
    value for Resources#extraResourcePaths MUST NOT contain any separating character other
than a "," and MUST be ended after the
     last character by a " directly !!!

    this will work: extraResourcePaths="/=a,/=b"
    this will NOT work: extraResourcePaths="/=a,/=b "
    this will NOT work: extraResourcePaths="/=a, /=b"
  -->
  <Resources className="org.apache.naming.resources.VirtualDirContext"
      extraResourcePaths="/=${project.basedir}/src/main/webapp,/=${project.basedir}/../my-other-module/src/main/resources/META-INF/resources"
/>
</Context>
{code}
                  
> Scan resources executing run goal
> ---------------------------------
>
>                 Key: MTOMCAT-187
>                 URL: https://issues.apache.org/jira/browse/MTOMCAT-187
>             Project: Apache Tomcat Maven Plugin
>          Issue Type: Question
>          Components: tomcat7
>    Affects Versions: 2.0-beta-1
>            Reporter: Sergio Fernández
>            Assignee: Olivier Lamy (*$^¨%`£)
>            Priority: Minor
>              Labels: maven
>             Fix For: 2.1
>
>
> I tried to find this detail at the documentation, but sorry but I didn't.
> The question is: does the plugin has any way to force the goal tomcat7:run to scan (and
updated when are modified) resources? Something equivalent to scanIntervalSeconds in the maven
jetty plugin.
> Thanks in advance. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


Mime
View raw message