4 Replies Latest reply on Mar 29, 2012 12:31 PM by veitg

    How to specify jboss home on VM level

    veitg

      Hi.

       

      I know I can set the JBOSS_HOME in the OS environment or via arquillian.xml. But since the JBOSS_HOME is already "taken" by another JBoss instance on my developer

      machine and the xml is shared between several developers, it would be nice if one could specify it via jvm system property like -Djboss.home.dir or such. Tried

      the latter without success.

       

      Is it possible?

       

      Thanks

      Veit

        • 1. Re: How to specify jboss home on VM level
          aslak

          In Arquillian Core CR7, you should be able to use environment variable replacement in arquillian.xml

           

          <property name="jbossHome">${my.other.variable}</property>

          Optionally as ${my.other.variable, default_value_if_other_not_found, .....}

           

          But keep in mind that in most cases when running via Maven Surefire, Surefire will fork a new jvm, so you have to set these variables in the Surefire configuraiton, e.g. via :

           

          <systemPropertyVariables>

            <my.other.value>value</my.other.value>

          </systemPropertyVariables>

          1 of 1 people found this helpful
          • 2. Re: How to specify jboss home on VM level
            veitg

            Hi.

             

            Thanks for the quick reply. Placing a variable in the xml works as you described.

            But sadly this won't fix my problem . Because everyone has to set this variable in their Eclipse run configurations then.

            The default to use JBOSS_HOME is good if nothing else is specified. It would be nice if this could be overridden by the jvm system properties - If one is set.

            If none is set, use the JBOSS_HOME. If not set, fail. Is something like that possible?

            • 3. Re: How to specify jboss home on VM level
              aslak

              so you want a custom env variable if it's set, if not use JBOSS_HOME, and if JBOSS_HOME is not set, then fail ?

               

              ${my.variable, JBOSS_HOME}

               

              if my.variable is not set, JBOSS_HOME will be used. If JBOSS_HOME is not set, it 'should' pass null to the configuration and it will fail with JBOSS_HOME or jbossHome not set .. ?

              • 4. Re: How to specify jboss home on VM level
                veitg

                Exactly.

                 

                I placed ${jboss.home, JBOSS_HOME} into my xml. Then, in eclipse in run configurations I set -Djboss.home=d:\foo\myjboss7.

                This works. If I remove -D completely from the run configuration and run it, deploying fails with:

                 

                org.jboss.arquillian.container.spi.ConfigurationException: jbossHome '${jboss.home, JBOSS_HOME}' must exist

                 

                I guess in this case it tries to find JBOSS_HOME in the java system props as well and NOT in the OS env (where I set JBOSS_HOME to an JBoss 5 installation)

                 

                I'm using 1.0.0-Final-SNAPSHOT (BTW: final-SNAPSHOT is a funny name though ).