8 Replies Latest reply on Apr 23, 2012 3:00 PM by starksm64

    How to add another jboss-home/modules root

    starksm64

      I'm not seeing this in the current admin guide, so a question that is coming up in the context of user's wanting to extend the modules in an envrionment where they cannot add modules to the jbossas7 installation they have been given, but there is the option to support something like:

       

      jbossaas-7.0/

         +- modules

         +- user-modules

       

      Is there a way to configure the modules layer to pickup such a user-modules directory?

        • 1. Re: How to add another jboss-home/modules root
          kabirkhan

          From org.jboss.modules.Main

           

                  System.out.println("    -mp <search path of directories>");

                  System.out.println("                  A list of directories, separated by '" + File.pathSeparator + "', where modules may be located");

                  System.out.println("                  If not specified, the value of the \"module.path\" system property is used");

           

          So you could modify standalone.sh to include more directories

          • 2. Re: How to add another jboss-home/modules root
            alesj

            I think there is some system property that list all possible module "repositories".

            Where by default it goes to JBOSS_HOME/modules.

            But I'm not 100% ... :-)

            • 3. Re: How to add another jboss-home/modules root
              starksm64

              Thanks, I'll probably use the standalone.sh -mp arg. I did get a chance to look at the code, and the -mp arg just sets the module.path system property as the help msg Kabir shows said. I did find that there is a MODULEPATH environment variable that is checked as well as the default value for the module.path system property, so that is another option.

              • 4. Re: How to add another jboss-home/modules root
                galder.zamarreno

                Scott, which option did you go for in the end? I need to do something similar.

                 

                The problem of MODULEPATH is how to set it to something that works with relative folders and you have to add the $JBOSS_HOME/modules to it too.

                 

                Btw, seems like -mp is not an option of standalone.sh itself, but rather the internal main.

                • 5. Re: How to add another jboss-home/modules root
                  galder.zamarreno

                  Btw, I'd rather not touch standalone.sh.

                  • 6. Re: How to add another jboss-home/modules root
                    ctomc

                    If you do not want to modify standalone.sh/bat just set JBOSS_MODULEPATH env variable, and make sure that $JBOSS_HOME\modules

                     

                    set  JBOSS_MODULEPATH=$JBOSS_HOME/modules:/path/to/my/modules

                     

                    also make sure that what is the name of variable, it was changed from MODULE_PATH to MODULEPATH and is now JBOSS_MODULEPATH(7.1.0+) as other two ware clashing with some other sofware..

                     

                     

                    --

                    tomaz

                    1 of 1 people found this helpful
                    • 7. Re: How to add another jboss-home/modules root
                      galder.zamarreno

                      At least in 7.1.0.CR1b, that only really works if $JBOSS_HOME is set in advance, iow, if you go and set it explicitly. Otherwise, it won't work.

                       

                      standalone.sh calculates where $JBOSS_HOME is without the need to specificy which is ideal, so the easiest thing here so far IMO is to go and modify standalone.sh directly and convert:

                       

                      MODULEPATH="$JBOSS_HOME/modules"

                       

                      into:

                       

                      MODULEPATH="$JBOSS_HOME/modules:$JBOSS_HOME/xyz"

                      • 8. Re: How to add another jboss-home/modules root
                        starksm64

                        What we ended up doing in OpenShift is to set the JBOSS_MODULEPATH in our own version of standalone.conf. We do also have our own version of standalone.sh, so we are not relying on the distribution version.