title: How to resolve resource-root path for jboss-deployment-structure inside the docker
body: <p>I have a jar which can't be copied to ear while generating docker-image. Also, I can't add the jars as modules because of some dependency issue.
  So, I have added below resource-root in my jboss-deployment-structure file(To make it same as copying the jar in the EAR's lib directory).</p>
  
  <p>
  
      
      false</p>
  
  <pre><code>&lt;!-- This corresponds to the top level deployment. For a war this is the war's module, for an ear --&gt;
  &lt;!-- This is the top level ear module, which contains all the classes in the EAR's lib folder     --&gt;
  &lt;deployment&gt;
  
      &lt;!-- exclude-subsystem prevents a subsystems deployment unit processors running on a deployment --&gt;
      &lt;!-- which gives basically the same effect as removing the subsystem, but it only affects single deployment --&gt;
      &lt;exclude-subsystems&gt;
          &lt;subsystem name="jpa"/&gt;
      &lt;/exclude-subsystems&gt;
  
      &lt;dependencies&gt;
          &lt;module name="org.abc" services="import"/&gt;
          &lt;module name="org.abcde.zye" optional="true"/&gt;
      &lt;/dependencies&gt;
      &lt;resources&gt;
      &lt;!-- These add additional classes to the module. In this case it is the same as including the jar in the EAR's lib directory --&gt;
          &lt;resource-root path="/../../../standalone/outsideEar/outside-abc.jar"/&gt;
      &lt;/resources&gt;
  &lt;/deployment&gt;
  &lt;sub-deployment name="abc-abc.war"&gt;
      &lt;dependencies&gt;
          &lt;module name="org.abcde.zye" optional="true"/&gt;
      &lt;/dependencies&gt;
  &lt;/sub-deployment&gt;
  &lt;sub-deployment name="abc-ejb.jar"&gt;
      &lt;dependencies&gt;
          &lt;module name="org.abcde.zye" optional="true"/&gt;
      &lt;/dependencies&gt;
  &lt;/sub-deployment&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>My Ear Structure:</strong></p>
  
  <pre><code>my-ear.ear
     |- lib
     |- abc-abc.war
     |- abc-ejb.jar
     |- META-INF
          |- application.xml
          |- jboss-app.xml
          |- jboss-deployment-structure.xml
          |- maven
               |- pom.properties
               |- pom.xml 
  </code></pre>
  
  <p>When <strong>I deploy this ear to wildfly-15.0.1.Final server outside the docker it works fine</strong>. 
  Path for resource-root is resolved, outside-abc.jar is copied to the below tmp folder (which is generated dynamically on server start) and I am able to perform operation by using classes of outside-abc.jar.
  <strong>wildfly-15.0.1.Final\standalone\tmp\vfs\deployment\deploymentdc506469ec651715</strong></p>
  
  <p><strong>wildfly-15.0.1.Final structure:</strong>  </p>
  
  <pre><code>wildfly-15.0.1.Final
    |- bin
    |- domain
    |- modules
    |- standalone
         |- outsideEar
            &lt;!-- This path is resolved with resource-root path="/../../../standalone/outsideEar/outside-abc.jar" --&gt;
             |- outside-abc.jar
         |- configuration
         |- data
         |- deployments
              |- my-ear.ear
         |- lib
         |- log
         |- tmp
    |-jboss-modules.jar
  </code></pre>
  
  <p>One More case which works fine: If I use below resource-root then my jar should be inside bin folder as wildfly-15.0.1.Final/bin/outsideEar/outside-abc.jar
  <code>&lt;resource-root path="../../outsideEar/outside-abc.jar"/&gt;</code></p>
  
  <p><strong>Docker configuration:</strong></p>
  
  <p>If I use <strong>same above structure, build docker image and start container for the image</strong>. It is <strong>not able to identify the jar file and do not copy it to 
  wildfly-15.0.1.Final\standalone\tmp\vfs\deployment\deploymentdc506469ec651715</strong> folder which eventually <strong>causes ClassNotFoundException</strong> while performing operations.
  I have <strong>verified that outside-abc.jar is properly copied to the mounted docker</strong> directory(Already added configuration in docker-compose file).</p>
  
  <p>I have been further inside of this and found that a attribute <code>use-physical-code-source="true"</code> can be set for resource-root to resolve the path using physical source code location. </p>
  
  <p>When <code>use-physical-code-source="true"</code> : It reads from physical location. I am not getting what is the actual physical location inside the docker. I think it is deployments folder or deployments/my-ear.ear/META-INF.</p>
  
  <p>When <code>use-physical-code-source="false"(default is false)</code> : It reads from vfs directory(Inside temp).</p>
  
  <p>I tried many different paths to make it work but, there was no luck.</p>
  
  <p><strong>Possible cases I tried:</strong> </p>
  
  <pre><code>&lt;resource-root path="./../../../../../../../../outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./../../../../../../../../outsideEar/outside-abc.jar"/&gt;
              &lt;resource-root path="./../../../../../../../../../standalone/outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./../../../../../../../../../standalone/outsideEar/outside-abc.jar"/&gt;
  
              &lt;resource-root path="./../../../../../../../outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./../../../../../../../outsideEar/outside-abc.jar"/&gt;
              &lt;resource-root path="./../../../../../../../../standalone/outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./../../../../../../../../standalone/outsideEar/outside-abc.jar"/&gt;
  
              &lt;resource-root path="./../../../../../../outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./../../../../../../outsideEar/outside-abc.jar"/&gt;
              &lt;resource-root path="./../../../../../../../standalone/outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./../../../../../../../standalone/outsideEar/outside-abc.jar"/&gt;
  
              &lt;resource-root path="./../../../../../outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./../../../../../outsideEar/outside-abc.jar"/&gt;
              &lt;resource-root path="./../../../../../../standalone/outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./../../../../../../standalone/outsideEar/outside-abc.jar"/&gt;
  
              &lt;resource-root path="./../../../../outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./../../../../outsideEar/outside-abc.jar"/&gt;
              &lt;resource-root path="./../../../../../standalone/outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./../../../../../standalone/outsideEar/outside-abc.jar"/&gt;
  
              &lt;resource-root path="./../../../outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./../../../outsideEar/outside-abc.jar"/&gt;
              &lt;resource-root path="./../../../../standalone/outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./../../../../standalone/outsideEar/outside-abc.jar"/&gt;
  
              &lt;resource-root path="./../../outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./../../outsideEar/outside-abc.jar"/&gt;
              &lt;resource-root path="./../../../standalone/outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./../../../standalone/outsideEar/outside-abc.jar"/&gt;
  
              &lt;resource-root path="./../outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./../outsideEar/outside-abc.jar"/&gt;
              &lt;resource-root path="./../../standalone/outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./../../standalone/outsideEar/outside-abc.jar"/&gt;
  
              &lt;resource-root path="./outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./outsideEar/outside-abc.jar"/&gt;
              &lt;resource-root path="./../standalone/outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./../standalone/outsideEar/outside-abc.jar"/&gt;
  
              &lt;resource-root path="./standalone/outsideEar/outside-abc.jar" use-physical-code-source="true"/&gt;
              &lt;resource-root path="./standalone/outsideEar/outside-abc.jar"/&gt;
  </code></pre>
  
  <p>For above cases, <strong>I have mounted jars inside both bin and standalone folders</strong> as bin/outsideEar/outside-abc.jar and standalone/outsideEar/outside-abc.jar. So, I <strong>confirm jar is available to the docker wildlfy</strong> server.</p>
  
  <p><strong>Requirement summary:</strong> </p>
  
  <ul>
  <li><p>How is resource-root path resolved(inside and outside docker) when
  use-physical-code-source="true" and use-physical-code-source="false"?</p></li>
  <li><p>Is there any way to pass only directory name for resource root so that
  all the jars under that directory can be copied to tmp/deployment. If
  not possible, then is there any  way which can be applied to pass jar
  name dynamically to the jboss-deployment-structure.xml using either properties file or environment variable so that at container start-up jar can be copied to the temp/deployment.</p></li>
  </ul>
  
  <p>Any assistance you can provide would be greatly appreciated.</p>
  
  <p>Thank you.</p>