Details

    • Type: Question Question
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-1
    • Fix Version/s: 2.1
    • Component/s: tomcat7
    • Labels:

      Description

      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.

        Activity

        Sergio Fernández created issue -
        Sergio Fernández made changes -
        Field Original Value New Value
        Description 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?

        Thanks in advance.
        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.
        Show
        Olivier Lamy (*$^¨%`£) added a comment - Did you have a look at http://tomcat.apache.org/maven-plugin-2.1-SNAPSHOT/tomcat7-maven-plugin/run-mojo.html#backgroundProcessorDelay
        Hide
        Sergio Fernández added a comment -

        Umm, not... I'll try it. What's the semantics of -1 as default value?

        Show
        Sergio Fernández added a comment - Umm, not... I'll try it. What's the semantics of -1 as default value?
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        -1 == never

        Show
        Olivier Lamy (*$^¨%`£) added a comment - -1 == never
        Hide
        Sergio Fernández added a comment -

        Not working for me:

        <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.0</version>
        <configuration>
        <backgroundProcessorDelay>10</backgroundProcessorDelay>
        </configuration>
        </plugin>

        Modified resources are not refreshed at the webapp :-/

        Show
        Sergio Fernández added a comment - Not working for me: <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.0</version> <configuration> <backgroundProcessorDelay>10</backgroundProcessorDelay> </configuration> </plugin> Modified resources are not refreshed at the webapp :-/
        Olivier Lamy (*$^¨%`£) made changes -
        Fix Version/s 2.1 [ 12320767 ]
        Hide
        Sergio Fernández added a comment -

        so, bug confirmed?
        awaiting to have it fix it at 2.1-SNAPSHOT
        thanks!

        Show
        Sergio Fernández added a comment - so, bug confirmed? awaiting to have it fix it at 2.1-SNAPSHOT thanks!
        Hide
        Arne Franken added a comment - - edited

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

        <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.0</version>
        <configuration>
        <contextFile>$

        Unknown macro: {project.basedir}

        /src/main/path/to/tomcat-context.xml</contextFile>
        </configuration>
        </plugin>

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

        <?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="/=$

        Unknown macro: {project.basedir}

        /src/main/webapp,/=$

        /../my-other-module/src/main/resources/META-INF/resources" />
        </Context>

        Show
        Arne Franken added a comment - - edited If you spread your resources across multiple maven modules, you could configure a context.xml in the plugin configuration: <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.0</version> <configuration> <contextFile>$ Unknown macro: {project.basedir} /src/main/path/to/tomcat-context.xml</contextFile> </configuration> </plugin> and then add directories that the tomcat should scan to that file: <?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="/=$ Unknown macro: {project.basedir} /src/main/webapp,/=$ /../my-other-module/src/main/resources/META-INF/resources" /> </Context>
        Hide
        Glen Mazza added a comment -

        Arne's solution may work, but the apparent issue (which needs confirmation still) is that backgroundProcessorDelay isn't working.

        Show
        Glen Mazza added a comment - Arne's solution may work, but the apparent issue (which needs confirmation still) is that backgroundProcessorDelay isn't working.
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        note contextReloadable field need to be set to true too.

        Show
        Olivier Lamy (*$^¨%`£) added a comment - note contextReloadable field need to be set to true too.
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        I will change behaviour to ( contextReloadable || backgroundProcessorDelay > 0 )

        Show
        Olivier Lamy (*$^¨%`£) added a comment - I will change behaviour to ( contextReloadable || backgroundProcessorDelay > 0 )
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        implemented.

        Show
        Olivier Lamy (*$^¨%`£) added a comment - implemented.
        Olivier Lamy (*$^¨%`£) made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        Sergio Fernández added a comment -

        thanks!
        when will be available as 2.1-SNAPSHOT?

        Show
        Sergio Fernández added a comment - thanks! when will be available as 2.1-SNAPSHOT?
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        yup when https://builds.apache.org/view/S-Z/view/Tomcat/job/TomcatMavenPlugin-mvn3.x/ #228 will be finished.

        But with 2.0 you can use
        <contextReloadable>true</contextReloadable>
        <backgroundProcessorDelay>10</backgroundProcessorDelay>

        Show
        Olivier Lamy (*$^¨%`£) added a comment - yup when https://builds.apache.org/view/S-Z/view/Tomcat/job/TomcatMavenPlugin-mvn3.x/ #228 will be finished. But with 2.0 you can use <contextReloadable>true</contextReloadable> <backgroundProcessorDelay>10</backgroundProcessorDelay>
        Hide
        Sergio Fernández added a comment -

        That's true! Knowing it I can even you 2.0. Thanks.

        Show
        Sergio Fernández added a comment - That's true! Knowing it I can even you 2.0. Thanks.
        Hide
        Hudson added a comment -

        Integrated in TomcatMavenPlugin-mvn3.x #228 (See https://builds.apache.org/job/TomcatMavenPlugin-mvn3.x/228/)
        MTOMCAT-187 Scan resources executing run goal
        ease configuration of reloadable feature. (Revision 1440408)

        Result = UNSTABLE
        olamy : http://svn.apache.org/viewvc/?view=rev&rev=1440408
        Files :

        • /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractRunMojo.java
        • /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RunMojo.java
        • /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java
        • /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/RunMojo.java
        Show
        Hudson added a comment - Integrated in TomcatMavenPlugin-mvn3.x #228 (See https://builds.apache.org/job/TomcatMavenPlugin-mvn3.x/228/ ) MTOMCAT-187 Scan resources executing run goal ease configuration of reloadable feature. (Revision 1440408) Result = UNSTABLE olamy : http://svn.apache.org/viewvc/?view=rev&rev=1440408 Files : /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractRunMojo.java /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RunMojo.java /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/RunMojo.java
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        57d 21h 33m 1 Olivier Lamy (*$^¨%`£) 30/Jan/13 13:30

          People

          • Assignee:
            Olivier Lamy (*$^¨%`£)
            Reporter:
            Sergio Fernández
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development