Author: lukaszlenart
Date: Sun Jan 20 19:44:55 2013
New Revision: 1435931

URL: http://svn.apache.org/viewvc?rev=1435931&view=rev
Log:
WW-3916 adds usage of the latest Jetty plugin

Added:
    struts/struts2/trunk/apps/mailreader/src/main/resources/log4j.properties
      - copied unchanged from r1434896, 
struts/struts2/trunk/apps/showcase/src/main/resources/log4j.properties
    
struts/struts2/trunk/archetypes/struts2-archetype-blank/src/main/resources/archetype-resources/src/main/resources/log4j.properties
      - copied unchanged from r1434896, 
struts/struts2/trunk/apps/rest-showcase/src/main/resources/log4j.properties
    
struts/struts2/trunk/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/src/main/resources/log4j.properties
Modified:
    struts/struts2/trunk/apps/mailreader/pom.xml
    struts/struts2/trunk/apps/mailreader/src/main/webapp/WEB-INF/database.xml
    struts/struts2/trunk/apps/rest-showcase/pom.xml
    struts/struts2/trunk/apps/showcase/pom.xml
    
struts/struts2/trunk/archetypes/struts2-archetype-blank/src/main/resources/archetype-resources/pom.xml
    
struts/struts2/trunk/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/pom.xml
    
struts/struts2/trunk/archetypes/struts2-archetype-starter/src/main/resources/archetype-resources/pom.xml
    
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
    
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java

Modified: struts/struts2/trunk/apps/mailreader/pom.xml
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/apps/mailreader/pom.xml?rev=1435931&r1=1435930&r2=1435931&view=diff
==============================================================================
--- struts/struts2/trunk/apps/mailreader/pom.xml (original)
+++ struts/struts2/trunk/apps/mailreader/pom.xml Sun Jan 20 19:44:55 2013
@@ -68,11 +68,35 @@
         <plugins>
             <plugin>
                 <groupId>org.mortbay.jetty</groupId>
-                <artifactId>maven-jetty-plugin</artifactId>
-                <version>6.0.1</version>
+                <artifactId>jetty-maven-plugin</artifactId>
+                <version>8.1.7.v20120910</version>
                 <configuration>
+                    <stopKey>CTRL+C</stopKey>
+                    <stopPort>8999</stopPort>
+                    <systemProperties>
+                        <systemProperty>
+                            <name>log4j.configuration</name>
+                            
<value>file:${basedir}/src/main/resources/log4j.properties</value>
+                        </systemProperty>
+                        <systemProperty>
+                            <name>slf4j</name>
+                            <value>false</value>
+                        </systemProperty>
+                    </systemProperties>
                     <scanIntervalSeconds>10</scanIntervalSeconds>
+                    
<webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
+                    <webAppConfig>
+                        <contextPath>/struts2-mailreader</contextPath>
+                        
<descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
+                    </webAppConfig>
                 </configuration>
+                <dependencies>
+                    <dependency>
+                        <groupId>log4j</groupId>
+                        <artifactId>log4j</artifactId>
+                        <version>1.2.16</version>
+                    </dependency>
+                </dependencies>
             </plugin>
         </plugins>
     </build>

Modified: 
struts/struts2/trunk/apps/mailreader/src/main/webapp/WEB-INF/database.xml
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/apps/mailreader/src/main/webapp/WEB-INF/database.xml?rev=1435931&r1=1435930&r2=1435931&view=diff
==============================================================================
--- struts/struts2/trunk/apps/mailreader/src/main/webapp/WEB-INF/database.xml 
(original)
+++ struts/struts2/trunk/apps/mailreader/src/main/webapp/WEB-INF/database.xml 
Sun Jan 20 19:44:55 2013
@@ -1,13 +1,9 @@
 <?xml version='1.0'?>
 <database>
-    <user username="user" fromAddress="[email protected]"
-          fullName="John Q. User" password="pass">
-        <subscription host="mail.hotmail.com" autoConnect="false"
-                      password="bar" type="pop3" username="user1234">
-        </subscription>
-        <subscription host="mail.yahoo.com" autoConnect="false" password="foo"
-                      type="imap" username="jquser">
-        </subscription>
-    </user>
+  <user username="user" fromAddress="[email protected]" fullName="John 
Q. User" password="pass">
+    <subscription host="mail.yahoo.com" autoConnect="false" password="foo" 
type="imap" username="jquser">
+    </subscription>
+    <subscription host="mail.hotmail.com" autoConnect="false" password="bar" 
type="pop3" username="user1234">
+    </subscription>
+  </user>
 </database>
-        
\ No newline at end of file

Modified: struts/struts2/trunk/apps/rest-showcase/pom.xml
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/apps/rest-showcase/pom.xml?rev=1435931&r1=1435930&r2=1435931&view=diff
==============================================================================
--- struts/struts2/trunk/apps/rest-showcase/pom.xml (original)
+++ struts/struts2/trunk/apps/rest-showcase/pom.xml Sun Jan 20 19:44:55 2013
@@ -101,8 +101,10 @@
             <plugin>
                 <groupId>org.mortbay.jetty</groupId>
                 <artifactId>jetty-maven-plugin</artifactId>
-                <version>8.0.0.M2</version>
+                <version>8.1.7.v20120910</version>
                 <configuration>
+                    <stopKey>CTRL+C</stopKey>
+                    <stopPort>8999</stopPort>
                     <systemProperties>
                         <systemProperty>
                             <name>log4j.configuration</name>

Modified: struts/struts2/trunk/apps/showcase/pom.xml
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/pom.xml?rev=1435931&r1=1435930&r2=1435931&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/pom.xml (original)
+++ struts/struts2/trunk/apps/showcase/pom.xml Sun Jan 20 19:44:55 2013
@@ -204,8 +204,10 @@
             <plugin>
                 <groupId>org.mortbay.jetty</groupId>
                 <artifactId>jetty-maven-plugin</artifactId>
-                <version>8.0.0.M2</version>
+                <version>8.1.7.v20120910</version>
                 <configuration>
+                    <stopKey>CTRL+C</stopKey>
+                    <stopPort>8999</stopPort>
                     <systemProperties>
                         <systemProperty>
                             <name>log4j.configuration</name>

Modified: 
struts/struts2/trunk/archetypes/struts2-archetype-blank/src/main/resources/archetype-resources/pom.xml
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/archetypes/struts2-archetype-blank/src/main/resources/archetype-resources/pom.xml?rev=1435931&r1=1435930&r2=1435931&view=diff
==============================================================================
--- 
struts/struts2/trunk/archetypes/struts2-archetype-blank/src/main/resources/archetype-resources/pom.xml
 (original)
+++ 
struts/struts2/trunk/archetypes/struts2-archetype-blank/src/main/resources/archetype-resources/pom.xml
 Sun Jan 20 19:44:55 2013
@@ -66,17 +66,35 @@
         <plugins>
             <plugin>
                 <groupId>org.mortbay.jetty</groupId>
-                <artifactId>maven-jetty-plugin</artifactId>
-                <version>6.1.21</version>
+                <artifactId>jetty-maven-plugin</artifactId>
+                <version>8.1.7.v20120910</version>
                 <configuration>
+                    <stopKey>CTRL+C</stopKey>
+                    <stopPort>8999</stopPort>
+                    <systemProperties>
+                        <systemProperty>
+                            <name>log4j.configuration</name>
+                            
<value>file:${basedir}/src/main/resources/log4j.properties</value>
+                        </systemProperty>
+                        <systemProperty>
+                            <name>slf4j</name>
+                            <value>false</value>
+                        </systemProperty>
+                    </systemProperties>
                     <scanIntervalSeconds>10</scanIntervalSeconds>
-                    <scanTargets>
-                        <scanTarget>src/main/webapp/WEB-INF</scanTarget>
-                        
<scanTarget>src/main/webapp/WEB-INF/web.xml</scanTarget>
-                        <scanTarget>src/main/resources/struts.xml</scanTarget>
-                        <scanTarget>src/main/resources/example.xml</scanTarget>
-                    </scanTargets>
+                    
<webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
+                    <webAppConfig>
+                        <contextPath>/struts2-blank</contextPath>
+                        
<descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
+                    </webAppConfig>
                 </configuration>
+                <dependencies>
+                    <dependency>
+                        <groupId>log4j</groupId>
+                        <artifactId>log4j</artifactId>
+                        <version>1.2.16</version>
+                    </dependency>
+                </dependencies>
             </plugin>
         </plugins>
     </build>

Modified: 
struts/struts2/trunk/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/pom.xml
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/pom.xml?rev=1435931&r1=1435930&r2=1435931&view=diff
==============================================================================
--- 
struts/struts2/trunk/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/pom.xml
 (original)
+++ 
struts/struts2/trunk/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/pom.xml
 Sun Jan 20 19:44:55 2013
@@ -80,16 +80,35 @@
             </plugin>
             <plugin>
                 <groupId>org.mortbay.jetty</groupId>
-                <artifactId>maven-jetty-plugin</artifactId>
-                <version>6.1.21</version>
+                <artifactId>jetty-maven-plugin</artifactId>
+                <version>8.1.7.v20120910</version>
                 <configuration>
+                    <stopKey>CTRL+C</stopKey>
+                    <stopPort>8999</stopPort>
+                    <systemProperties>
+                        <systemProperty>
+                            <name>log4j.configuration</name>
+                            
<value>file:${basedir}/src/main/resources/log4j.properties</value>
+                        </systemProperty>
+                        <systemProperty>
+                            <name>slf4j</name>
+                            <value>false</value>
+                        </systemProperty>
+                    </systemProperties>
                     <scanIntervalSeconds>10</scanIntervalSeconds>
-                    <scanTargets>
-                        <scanTarget>src/main/webapp/WEB-INF</scanTarget>
-                        
<scanTarget>src/main/webapp/WEB-INF/web.xml</scanTarget>
-                        <scanTarget>src/main/resources/struts.xml</scanTarget>
-                    </scanTargets>
+                    
<webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
+                    <webAppConfig>
+                        <contextPath>/struts2-showcase</contextPath>
+                        
<descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
+                    </webAppConfig>
                 </configuration>
+                <dependencies>
+                    <dependency>
+                        <groupId>log4j</groupId>
+                        <artifactId>log4j</artifactId>
+                        <version>1.2.16</version>
+                    </dependency>
+                </dependencies>
             </plugin>
         </plugins>
     </build>

Added: 
struts/struts2/trunk/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/src/main/resources/log4j.properties
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/src/main/resources/log4j.properties?rev=1435931&view=auto
==============================================================================
--- 
struts/struts2/trunk/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/src/main/resources/log4j.properties
 (added)
+++ 
struts/struts2/trunk/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/src/main/resources/log4j.properties
 Sun Jan 20 19:44:55 2013
@@ -0,0 +1,29 @@
+#
+# Log4J Settings for log4j 1.2.x (via jakarta-commons-logging)
+#
+# The five logging levels used by Log are (in order):
+#
+#   1. DEBUG (the least serious)
+#   2. INFO
+#   3. WARN
+#   4. ERROR
+#   5. FATAL (the most serious)
+
+
+# Set root logger level to WARN and append to stdout
+log4j.rootLogger=WARN, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %5p (%c:%L) - %m%n
+
+# Print only messages of level ERROR or above in the package noModule.
+log4j.logger.noModule=ERROR
+
+# OpenSymphony Stuff
+log4j.logger.com.opensymphony=INFO
+
+# Struts2 Stuff
+log4j.logger.org.apache.struts2=INFO

Modified: 
struts/struts2/trunk/archetypes/struts2-archetype-starter/src/main/resources/archetype-resources/pom.xml
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/archetypes/struts2-archetype-starter/src/main/resources/archetype-resources/pom.xml?rev=1435931&r1=1435930&r2=1435931&view=diff
==============================================================================
--- 
struts/struts2/trunk/archetypes/struts2-archetype-starter/src/main/resources/archetype-resources/pom.xml
 (original)
+++ 
struts/struts2/trunk/archetypes/struts2-archetype-starter/src/main/resources/archetype-resources/pom.xml
 Sun Jan 20 19:44:55 2013
@@ -88,19 +88,37 @@
                 </configuration>
             </plugin>
                <plugin>
-                       <groupId>org.mortbay.jetty</groupId>
-                       <artifactId>maven-jetty-plugin</artifactId>
-                       <version>6.1.21</version>
+                <groupId>org.mortbay.jetty</groupId>
+                <artifactId>jetty-maven-plugin</artifactId>
+                <version>8.1.7.v20120910</version>
                 <configuration>
+                    <stopKey>CTRL+C</stopKey>
+                    <stopPort>8999</stopPort>
+                    <systemProperties>
+                        <systemProperty>
+                            <name>log4j.configuration</name>
+                            
<value>file:${basedir}/src/main/resources/log4j.properties</value>
+                        </systemProperty>
+                        <systemProperty>
+                            <name>slf4j</name>
+                            <value>false</value>
+                        </systemProperty>
+                    </systemProperties>
                     <scanIntervalSeconds>10</scanIntervalSeconds>
-                    <scanTargets>
-                        <scanTarget>src/main/webapp/WEB-INF</scanTarget>
-                        
<scanTarget>src/main/webapp/WEB-INF/web.xml</scanTarget>
-                        <scanTarget>src/main/resources/struts.xml</scanTarget>
-                        
<scanTarget>src/main/resources/applicationContext.xml</scanTarget>
-                    </scanTargets>
+                    
<webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
+                    <webAppConfig>
+                        <contextPath>/struts2-showcase</contextPath>
+                        
<descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
+                    </webAppConfig>
                 </configuration>
-               </plugin>
+                <dependencies>
+                    <dependency>
+                        <groupId>log4j</groupId>
+                        <artifactId>log4j</artifactId>
+                        <version>1.2.16</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
        </plugins>
     </build>
 </project>

Modified: 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java?rev=1435931&r1=1435930&r2=1435931&view=diff
==============================================================================
--- 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
 (original)
+++ 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
 Sun Jan 20 19:44:55 2013
@@ -197,12 +197,9 @@ public class DispatcherTest extends Stru
         mockContainer.expectAndReturn("getInstance", 
C.args(C.eq(String.class), C.eq(XWorkConstants.RELOAD_XML_CONFIGURATION)),
                 reloadConfigs);
         mockContainer.expectAndReturn("getInstance", 
C.args(C.eq(ObjectFactory.class)), destroyedObjectFactory);
-        mockContainer.expectAndReturn("getInstance", 
C.args(C.eq(String.class), C.eq(XWorkConstants.RELOAD_XML_CONFIGURATION)),
-                reloadConfigs);
 
         mockConfiguration.expectAndReturn("getContainer", 
mockContainer.proxy());
         mockConfiguration.expectAndReturn("getContainer", 
mockContainer.proxy());
-        mockConfiguration.expectAndReturn("getContainer", 
mockContainer.proxy());
         mockConfiguration.expect("destroy");
         mockConfiguration.matchAndReturn("getPackageConfigs", new 
HashMap<String, PackageConfig>());
 
@@ -227,14 +224,12 @@ public class DispatcherTest extends Stru
         
         Map<String, PackageConfig> packageConfigs = new HashMap<String, 
PackageConfig>();
         packageConfigs.put("test", packageConfig);
-        
+
         Mock mockContainer = new Mock(Container.class);
         mockContainer.matchAndReturn("getInstance", 
C.args(C.eq(ObjectFactory.class)), new ObjectFactory());
         String reloadConfigs = container.getInstance(String.class, 
XWorkConstants.RELOAD_XML_CONFIGURATION);
         mockContainer.expectAndReturn("getInstance", 
C.args(C.eq(String.class), C.eq(XWorkConstants.RELOAD_XML_CONFIGURATION)),
                 reloadConfigs);
-        mockContainer.expectAndReturn("getInstance", 
C.args(C.eq(String.class), C.eq(XWorkConstants.RELOAD_XML_CONFIGURATION)),
-                reloadConfigs);
 
         Mock mockConfiguration = new Mock(Configuration.class);
         mockConfiguration.matchAndReturn("getPackageConfigs", packageConfigs);

Modified: 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java?rev=1435931&r1=1435930&r2=1435931&view=diff
==============================================================================
--- 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java
 (original)
+++ 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java
 Sun Jan 20 19:44:55 2013
@@ -19,7 +19,6 @@ import com.opensymphony.xwork2.XWorkCons
 import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
 import com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider;
 import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
-import com.opensymphony.xwork2.inject.Container;
 import com.opensymphony.xwork2.util.logging.Logger;
 import com.opensymphony.xwork2.util.logging.LoggerFactory;
 
@@ -46,6 +45,7 @@ public class ConfigurationManager {
     private List<PackageProvider> packageProviders = new 
CopyOnWriteArrayList<PackageProvider>();
     protected String defaultFrameworkBeanName;
     private boolean providersChanged = false;
+    private boolean reloadConfigs = true; // for the first time
 
     public ConfigurationManager() {
         this("xwork");
@@ -70,7 +70,7 @@ public class ConfigurationManager {
                 throw new ConfigurationException("Unable to load 
configuration.", e);
             }
         } else {
-            conditionalReload(configuration.getContainer());
+            conditionalReload();
         }
 
         return configuration;
@@ -169,10 +169,8 @@ public class ConfigurationManager {
 
     /**
      * Reloads the Configuration files if the configuration files indicate 
that they need to be reloaded.
-     * @param container current container used to obtain instance of {@link 
com.opensymphony.xwork2.util.fs.DefaultFileManager}
      */
-    public synchronized void conditionalReload(Container container) {
-        boolean reloadConfigs = 
Boolean.parseBoolean(container.getInstance(String.class, 
XWorkConstants.RELOAD_XML_CONFIGURATION));
+    public synchronized void conditionalReload() {
         if (reloadConfigs || providersChanged) {
             if (LOG.isDebugEnabled()) {
                 LOG.debug("Checking ConfigurationProviders for reload.");
@@ -185,16 +183,25 @@ public class ConfigurationManager {
             if (reload) {
                 reloadProviders(providers);
             }
+            updateReloadConfigsFlag();
             providersChanged = false;
         }
     }
 
+    private void updateReloadConfigsFlag() {
+        reloadConfigs = 
Boolean.parseBoolean(configuration.getContainer().getInstance(String.class, 
XWorkConstants.RELOAD_XML_CONFIGURATION));
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Updating [#0], current value is [#1], new value [#2]",
+                    XWorkConstants.RELOAD_XML_CONFIGURATION, 
String.valueOf(reloadConfigs), String.valueOf(reloadConfigs));
+        }
+    }
+
     private boolean needReloadPackageProviders() {
         if (packageProviders != null) {
             for (PackageProvider provider : packageProviders) {
                 if (provider.needsReload()) {
                     if (LOG.isInfoEnabled()) {
-                        LOG.info("Detected package provider " + provider + " 
needs to be reloaded.  Reloading all providers.");
+                        LOG.info("Detected package provider [#0] needs to be 
reloaded. Reloading all providers.", provider.toString());
                     }
                     return true;
                 }
@@ -207,7 +214,7 @@ public class ConfigurationManager {
         for (ContainerProvider provider : providers) {
             if (provider.needsReload()) {
                 if (LOG.isInfoEnabled()) {
-                    LOG.info("Detected container provider " + provider + " 
needs to be reloaded.  Reloading all providers.");
+                    LOG.info("Detected container provider [#0] needs to be 
reloaded. Reloading all providers.", provider.toString());
                 }
                 return true;
             }


Reply via email to