2 Replies Latest reply on May 6, 2016 5:46 AM by haiaw

    Setting system parameter in wildfly-maven-plugin - help needed

    haiaw

      Hi,


      I have below wildfly-maven-plugin config and I need to set log4j.configuration system parameter. Each developer has different ${project.basedir} folder thats why it is a property which is resolved by maven during build and provides required system property for log4j mechanism.

      I use 1.0.0.Final version of the plugin.


      
      
      <plugin>
        <groupId>org.wildfly.plugins</groupId>
        <artifactId>wildfly-maven-plugin</artifactId>
        <version>${version.wildfly.maven.plugin}</version>
        <configuration>
        <jbossHome>${jboss.home}</jbossHome>
        <serverConfig>${server.config}</serverConfig>
        <executeCommands>/system-property=log4j.configuration:write-attribute(name="value", value="file:${project.basedir}/src/resources/log4j.properties")
         </executeCommands>
        </configuration>
      </plugin>
      
      
      
      
      
      
      


      Unfortunatelly this parameter is not set..


      Just remember to change

      <jbossHome>${jboss.home}</jbossHome>
      
      
      

      to correct path and

      <jboss.home>yourpath\wildfly-9.0.2.Final</jboss.home>
      
      
      


      Aby help would be appreciated.

        • 1. Re: Setting system parameter in wildfly-maven-plugin - help needed
          jamezp

          You would have to start the container and execute the execute-commands goal in order for that system property to be added. Also your configurations is not definied correctly. See WildFly Maven Plugin – Execute Commands Example for details.

          mvn wildfly:start wildfly:execute-commands wildfly:shutdown
          

           

          Another option would be to use the <before-deployment> command option which the run goal and deploy goal use.

          <plugin>  
            <groupId>org.wildfly.plugins</groupId>  
            <artifactId>wildfly-maven-plugin</artifactId>  
            <version>${version.wildfly.maven.plugin}</version>  
            <configuration>  
                <jbossHome>${jboss.home}</jbossHome>  
                <serverConfig>${server.config}</serverConfig>
                <before-deployment>
                  <commands>
                      <command>/system-property=log4j.configuration:write-attribute(name="value", value="file:${project.basedir}/src/resources/log4j.properties")</command>
                  </commands>
                </before-deployment>
            </configuration>  
          </plugin>
          

           

          --

          James R. Perkins

          • 2. Re: Setting system parameter in wildfly-maven-plugin - help needed
            haiaw

            Thanks, works now