5 Replies Latest reply on Jun 2, 2014 3:52 AM by madhu.garimilla

    Custom directory for the modules deployed through CLI

    madhu.garimilla

      Hi,

       

      I am using Jboss EAP 6.1 Alpha. When i try to deploy any new jboss modules using CLI (with module add command), it creates a directory under modules folder. I would like create this directory at location of my choice which is basically out side jboss directory structure. Would Jboss allow this kind of use case? If yes, how to do that?

        • 1. Re: Custom directory for the modules deployed through CLI
          vbchin2

          As far as I know ... NO, as the server needs to know where the modules can be found at the bootup time. You might recall that it didn't create a reference to your JAR or folder, it actually copied the JAR to the modules folder.

          • 2. Re: Custom directory for the modules deployed through CLI
            wdfink

            Modules are copied to the module folder. later versions, not sure whether EAP6.1.Alpha do so, use a different folder structure system/... for provided modules.

            All other modules are copied to directories related to the module name.

            • 3. Re: Custom directory for the modules deployed through CLI
              madhu.garimilla

              We can set multiple directories for Modules so that Jboss would refer to those during boot up. In standalone.bat, we can

               

              set JBOSS_MODULEPATH=%JBOSS_HOME%/modules;/path/to/my/modules

               

              How can i tell jboss that the module i am adding through CLI(after jboss is up), should go to a specific directory even though i configured that directory in my standalone.bat?

              • 4. Re: Custom directory for the modules deployed through CLI
                vbchin2

                Agreed! And it goes back to my comment that server needs to know where to find modules at boot time. You are enforcing this knowledge to server with the $JBOSS_MODULEPATH.

                 

                However, assuming such an option does exist to let you add a module to a folder or path of your choice, who would in that case update the $JBOSS_MODULEPATH in the .sh or .conf files ? The CLI won't definitely touch the standalone.conf or .sh file for sure. So it becomes a two step process:

                1. Adding a module to custom folder/path
                2. Manual update of the configuration file to include that path for loading modules.

                 

                The above could be allowed by EAP folks but probably is deemed not a clean approach or not a popular usecase in demand. Having said all that, I usually have found manually putting the folder together in the modules root directory lot more easier and quicker way to do it unless that path is restricted to you (your login)

                • 5. Re: Custom directory for the modules deployed through CLI
                  madhu.garimilla

                  However, assuming such an option does exist to let you add a module to a folder or path of your choice, who would in that case update the $JBOSS_MODULEPATH in the .sh or .conf files ?

                  Every time we add a new module using CLI, we are not going to update $JBOSS_MODULEPATH. Instead, we choose one of the directories which are available(in $JBOSS_MODULEPATH) to Jboss at the boot time and try to add to the new module to that directory. so, step2 is not required here .

                   

                  1. Adding a module to custom folder/path
                  2. Manual update of the configuration file to include that path for loading modules.

                  The use case i am trying out is adding and removing some jboss modules dynamicaly with out restarting my Jboss server so i cannot tell my server in advance about those modules.