[jboss-dev] Redeploy an app if xml is added to metadata location?

Jaikiran Pai jpai at redhat.com
Tue Jun 2 03:19:14 EDT 2009


I just noticed that we redeploy an entire application if a xml file gets 
added/removed from the metadata locations of a application. For example, 
if in an exploded WAR file we add a somefile.xml to the WEB-INF folder 
the application gets redeployed (easily reproducible in ROOT.war). Why 
do we do this? I thought redeploy would be triggered by touching the 
deployment descriptor of the app (i.e. changing the last modified time 
of web.xml). Looks to be intentional from what i see in the 
configurations (profile.xml):

  <!-- This just checks metadata locations -->
  <bean name="MetaDataStructureModificationChecker" 
class="org.jboss.deployers.vfs.spi.structure.modified.MetaDataStructureModificationChecker">
    <constructor>
      <parameter><inject bean="MainDeployer" /></parameter>
    </constructor>
    <property name="cache"><inject bean="StructureModCache" /></property>
    <property name="filter"><bean 
class="org.jboss.system.server.profile.basic.XmlIncludeVirtualFileFilter" 
/></property>
  </bean>

org.jboss.deployers.vfs.spi.structure.modified.MetaDataStructureModificationChecker.hasStructureBeenModifed(...):

// do we have some new files or some were deleted
                  if (leaves != null && children != null && 
leaves.size() != children.size())
                  {
                     if (log.isTraceEnabled())
                        log.trace("Metadata files number changed, old: " 
+ leaves + ", now: " + children);
                     return true;
                  }

Why do we have to redeploy the application if a xml is added to the 
metadata folder of a application?

-Jaikiran



More information about the jboss-development mailing list