7 Replies Latest reply on Feb 26, 2015 9:38 PM by Lionel Orellana

    jboss-as-maven-plugin execute-commands

    wiktorowski maximilien Novice

      Hi,

       

      I'm trying to use jboss-as-maven-plugin 7.4.Final to launch cli commands on EAP6.1.0 in domain mode.

       

       

      <plugin>
                      <groupId>org.jboss.as.plugins</groupId>
                      <artifactId>jboss-as-maven-plugin</artifactId>
                      <version>7.4.Final</version>
                      <configuration>
                          <hostname>${jboss.ip}</hostname>
                          <port>${jboss.port}</port>
                          <username>admin</username>
                          <password>123456</password>
                          <execute-commands>
                              <commands>
                                  <command>/deployment=${project.build.finalName}.${project.packaging}:add(runtime-name="test.war", content=[{"path"=>"/Dev/workspace_indigo2/Platform/Test/target/test","archive"=>false}])</command>
                                   <command>deploy --name=test.war --server-groups=main-server-group</command>
                              </commands>
                          </execute-commands>
                      </configuration>
                  </plugin>
      

       

      but i got

      [ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.4.Final:execute-commands (default-cli) on project Test: Execution default-cli of goal org.jboss.as.plugins:jboss-as-maven-plugin:7.4.Final:execute-commands failed: Failed to initialize CLI context: Failed to parse C:\Digicash_6.1\jboss-eap-6.1\bin\jboss-cli.xml: ParseError at [row,col]:[6,38]
      [ERROR] Message: Unexpected element '{urn:jboss:cli:1.2}jboss-cli'
      [ERROR] -> [Help 1]
      [ERROR]
      

       

      Best regards,

        • 1. Re: jboss-as-maven-plugin execute-commands
          jaikiran pai Master

          C:\Digicash_6.1\jboss-eap-6.1\bin\jboss-cli.xml

          What are the contents of that file?

          • 2. Re: jboss-as-maven-plugin execute-commands
            wiktorowski maximilien Novice

            hi,

             

            it's the default one :

             

             

            <?xml version='1.0' encoding='UTF-8'?>
            
            <!--
               JBoss AS7 Command-line Interface configuration.
            -->
            <jboss-cli xmlns="urn:jboss:cli:1.2">
            
                <!-- The default controller to connect to when 'connect' command is executed w/o arguments -->
                <default-controller>
                    <host>localhost</host>
                    <port>9999</port>
                </default-controller>
                
                <validate-operation-requests>true</validate-operation-requests>
                
                <!-- whether to resolve system properties specified as command argument or operation parameter values
                     in the CLI VM before sending the operation requests to the controller -->
                <resolve-parameter-values>false</resolve-parameter-values>
                
                <!-- Command and operation history log configuration -->
                <history>
                    <enabled>true</enabled>
                    <file-name>.jboss-cli-history</file-name>
                    <file-dir>${user.home}</file-dir>
                    <max-size>500</max-size>
                </history>
                
                <!-- Whether to write info and error messages to the terminal output -->
                <silent>false</silent>
            </jboss-cli>
            
            • 3. Re: jboss-as-maven-plugin execute-commands
              jaikiran pai Master

              What's the output of:

               

              mvn dependency:resolve-plugins

               

              ont that project?

              • 4. Re: jboss-as-maven-plugin execute-commands
                wiktorowski maximilien Novice
                [INFO] --- maven-dependency-plugin:2.3:resolve-plugins (default-cli) @ platform-admin-ui ---
                [INFO] Plugin Resolved: jboss-as-maven-plugin-7.4.Final.jar
                [INFO]     Plugin Dependency Resolved: maven-plugin-api-3.0.4.jar
                [INFO]     Plugin Dependency Resolved: maven-project-2.2.1.jar
                [INFO]     Plugin Dependency Resolved: aether-api-1.13.1.jar
                [INFO]     Plugin Dependency Resolved: aether-util-1.13.1.jar
                [INFO]     Plugin Dependency Resolved: jboss-as-cli-7.1.2.Final.jar
                [INFO]     Plugin Dependency Resolved: jboss-as-controller-client-7.1.2.Final.jar
                [INFO]     Plugin Dependency Resolved: jboss-remoting-3.2.12.GA.jar
                [INFO]     Plugin Dependency Resolved: maven-plugin-annotations-3.2.jar
                [INFO]     Plugin Dependency Resolved: plexus-utils-3.0.10.jar
                [INFO]     Plugin Dependency Resolved: maven-settings-3.0.4.jar
                [INFO] Plugin Resolved: jrebel-maven-plugin-1.1.5.jar
                [INFO]     Plugin Dependency Resolved: maven-plugin-api-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-project-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: plexus-utils-1.4.1.jar
                [INFO]     Plugin Dependency Resolved: commons-io-1.4.jar
                [INFO]     Plugin Dependency Resolved: commons-lang-2.4.jar
                [INFO] Plugin Resolved: maven-scm-plugin-1.7.jar
                [INFO]     Plugin Dependency Resolved: maven-project-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-settings-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-plugin-api-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-scm-manager-plexus-1.7.jar
                [INFO]     Plugin Dependency Resolved: maven-scm-providers-standard-1.7.pom
                [INFO]     Plugin Dependency Resolved: maven-scm-provider-local-1.7.jar
                [INFO]     Plugin Dependency Resolved: maven-scm-provider-svn-commons-1.7.jar
                [INFO]     Plugin Dependency Resolved: plexus-utils-1.5.6.jar
                [INFO]     Plugin Dependency Resolved: file-management-1.2.1.jar
                [INFO]     Plugin Dependency Resolved: plexus-sec-dispatcher-1.3.jar
                [INFO] Plugin Resolved: maven-resources-plugin-2.4.3.jar
                SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
                SLF4J: Defaulting to no-operation (NOP) logger implementation
                SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
                Downloading: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-model/2.0.6/maven-model-2.0.6.jar
                Downloaded: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-model/2.0.6/maven-model-2.0.6.jar (85 KB at 67.0 KB/sec)
                Downloading: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-monitor/2.0.6/maven-monitor-2.0.6.jar
                Downloaded: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-monitor/2.0.6/maven-monitor-2.0.6.jar (11 KB at 6.5 KB/sec)
                Downloading: http://artifactory.mpulse.eu:8180/artifactory/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar
                Downloaded: http://artifactory.mpulse.eu:8180/artifactory/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar (190 KB at 240.0 KB/sec)
                [INFO]     Plugin Dependency Resolved: maven-plugin-api-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-project-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-core-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-artifact-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-settings-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-model-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-monitor-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: plexus-container-default-1.0-alpha-9-stable-1.jar
                [INFO]     Plugin Dependency Resolved: plexus-utils-2.0.5.jar
                [INFO]     Plugin Dependency Resolved: maven-filtering-1.0-beta-4.jar
                [INFO]     Plugin Dependency Resolved: plexus-interpolation-1.13.jar
                [INFO] Plugin Resolved: maven-surefire-plugin-2.7.1.jar
                Downloading: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9.jar
                Downloaded: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9.jar (13 KB at 25.7 KB/sec)
                Downloading: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-artifact/2.0.9/maven-artifact-2.0.9.jar
                Downloaded: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-artifact/2.0.9/maven-artifact-2.0.9.jar (87 KB at 228.5 KB/sec)
                Downloading: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-project/2.0.9/maven-project-2.0.9.jar
                Downloaded: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-project/2.0.9/maven-project-2.0.9.jar (119 KB at 290.1 KB/sec)
                Downloading: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-core/2.0.9/maven-core-2.0.9.jar
                Downloaded: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-core/2.0.9/maven-core-2.0.9.jar (156 KB at 399.7 KB/sec)
                Downloading: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-toolchain/2.0.9/maven-toolchain-2.0.9.jar
                Downloaded: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-toolchain/2.0.9/maven-toolchain-2.0.9.jar (38 KB at 105.9 KB/sec)
                [INFO]     Plugin Dependency Resolved: maven-plugin-api-2.0.9.jar
                [INFO]     Plugin Dependency Resolved: surefire-booter-2.7.1.jar
                [INFO]     Plugin Dependency Resolved: maven-surefire-common-2.7.1.jar
                [INFO]     Plugin Dependency Resolved: plexus-utils-2.0.5.jar
                [INFO]     Plugin Dependency Resolved: maven-artifact-2.0.9.jar
                [INFO]     Plugin Dependency Resolved: maven-project-2.0.9.jar
                [INFO]     Plugin Dependency Resolved: maven-core-2.0.9.jar
                [INFO]     Plugin Dependency Resolved: maven-toolchain-2.0.9.jar
                [INFO] Plugin Resolved: maven-deploy-plugin-2.5.jar
                [INFO]     Plugin Dependency Resolved: maven-plugin-api-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-project-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-model-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-artifact-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: plexus-utils-1.5.6.jar
                [INFO] Plugin Resolved: maven-clean-plugin-2.4.1.jar
                [INFO]     Plugin Dependency Resolved: maven-plugin-api-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: plexus-utils-2.0.5.jar
                [INFO] Plugin Resolved: maven-install-plugin-2.3.1.jar
                Downloading: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-artifact-manager/2.0.6/maven-artifact-manager-2.0.6.jar
                Downloaded: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-artifact-manager/2.0.6/maven-artifact-manager-2.0.6.jar (56 KB at 178.0 KB/sec)
                [INFO]     Plugin Dependency Resolved: maven-plugin-api-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-project-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-model-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-artifact-manager-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-artifact-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: plexus-utils-2.0.5.jar
                [INFO]     Plugin Dependency Resolved: plexus-digest-1.0.jar
                [INFO] Plugin Resolved: maven-compiler-plugin-2.3.2.jar
                Downloading: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-toolchain/1.0/maven-toolchain-1.0.jar
                Downloaded: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/maven-toolchain/1.0/maven-toolchain-1.0.jar (33 KB at 114.8 KB/sec)
                [INFO]     Plugin Dependency Resolved: maven-plugin-api-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-artifact-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-core-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-toolchain-1.0.jar
                [INFO]     Plugin Dependency Resolved: plexus-utils-2.0.5.jar
                [INFO]     Plugin Dependency Resolved: plexus-compiler-api-1.8.1.jar
                [INFO]     Plugin Dependency Resolved: plexus-compiler-manager-1.8.1.jar
                [INFO]     Plugin Dependency Resolved: plexus-compiler-javac-1.8.1.jar
                [INFO] Plugin Resolved: maven-war-plugin-2.1.1.jar
                [INFO]     Plugin Dependency Resolved: maven-plugin-api-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-artifact-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-model-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-project-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-core-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-settings-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-monitor-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-archiver-2.4.1.jar
                [INFO]     Plugin Dependency Resolved: plexus-archiver-1.2.jar
                [INFO]     Plugin Dependency Resolved: plexus-interpolation-1.13.jar
                [INFO]     Plugin Dependency Resolved: plexus-container-default-1.0-alpha-9-stable-1.jar
                [INFO]     Plugin Dependency Resolved: xstream-1.3.1.jar
                [INFO]     Plugin Dependency Resolved: plexus-utils-2.0.5.jar
                [INFO]     Plugin Dependency Resolved: maven-filtering-1.0-beta-2.jar
                [INFO] Plugin Resolved: maven-site-plugin-2.0.1.jar
                Downloading: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-4/wagon-provider-api-1.0-beta-4.jar
                Downloaded: http://artifactory.mpulse.eu:8180/artifactory/repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-4/wagon-provider-api-1.0-beta-4.jar (51 KB at 145.6 KB/sec)
                Downloading: http://artifactory.mpulse.eu:8180/artifactory/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-9/plexus-container-default-1.0-alpha-9.jar
                Downloaded: http://artifactory.mpulse.eu:8180/artifactory/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-9/plexus-container-default-1.0-alpha-9.jar (191 KB at 477.0 KB/sec)
                [INFO]     Plugin Dependency Resolved: maven-artifact-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-artifact-manager-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-model-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-plugin-api-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-project-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-settings-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: maven-reporting-api-2.0.6.jar
                [INFO]     Plugin Dependency Resolved: doxia-module-xhtml-1.0.jar
                [INFO]     Plugin Dependency Resolved: doxia-sink-api-1.0.jar
                [INFO]     Plugin Dependency Resolved: doxia-decoration-model-1.0.jar
                [INFO]     Plugin Dependency Resolved: doxia-site-renderer-1.0.jar
                [INFO]     Plugin Dependency Resolved: maven-doxia-tools-1.0.2.jar
                [INFO]     Plugin Dependency Resolved: wagon-provider-api-1.0-beta-4.jar
                [INFO]     Plugin Dependency Resolved: plexus-archiver-1.0-alpha-7.jar
                [INFO]     Plugin Dependency Resolved: plexus-container-default-1.0-alpha-9.jar
                [INFO]     Plugin Dependency Resolved: plexus-i18n-1.0-beta-7.jar
                [INFO]     Plugin Dependency Resolved: plexus-utils-1.5.1.jar
                [INFO]     Plugin Dependency Resolved: jetty-6.1.5.jar
                [INFO] ------------------------------------------------------------------------
                [INFO] BUILD SUCCESS
                [INFO] ------------------------------------------------------------------------
                [INFO] Total time: 9.964s
                [INFO] Finished at: Mon Jul 01 13:25:42 CEST 2013
                [INFO] Final Memory: 17M/330M
                [INFO] ------------------------------------------------------------------------
                
                • 5. Re: jboss-as-maven-plugin execute-commands
                  jaikiran pai Master

                  [INFO] Plugin Resolved: jboss-as-maven-plugin-7.4.Final.jar

                  .....

                  [INFO]     Plugin Dependency Resolved: jboss-as-cli-7.1.2.Final.jar

                  Given the dependency on 7.1.2.Final of CLI project, you won't be able to use 7.4 version of Maven plugin against EAP 6.1.  The 7.1.2.Final version of CLI artifact doesn't understand the urn:jboss:cli:1.2 namespace in the jboss-cli.xml since that namespace was added later for EAP 6.1.

                  • 7. Re: jboss-as-maven-plugin execute-commands
                    Lionel Orellana Newbie

                    You can force the jboss-as-maven-plugin to use a later version of jboss-as-cli.

                     

                    Even though 7.2.0 is the final upstream version of jboss-as-cli available before the wildfly re-branding; RedHat does have other versions available. For EAP 6.2 and 6.3 I use 7.3.0.Final-redhat-14.

                     

                    <version.jboss.maven.plugin>7.6.Final</version.jboss.maven.plugin>
                    <version.jboss.cli>7.3.0.Final-redhat-14</version.jboss.cli>
                    ...
                    pluginManagement>
                    plugins>
                    plugin>
                       <groupId>org.jboss.as.plugins</groupId>
                       <artifactId>jboss-as-maven-plugin</artifactId>
                       <version>${version.jboss.maven.plugin}</version>
                       <configuration>
                       <hostname>${jboss.hostname}</hostname>
                       <port>${jboss.port}</port>
                       <username>${jboss.username}</username>
                       <password>${jboss.password}</password>
                       </configuration>
                       <dependencies>
                       <dependency>
                       <groupId>org.jboss.as</groupId>
                       <artifactId>jboss-as-cli</artifactId>
                       <version>${version.jboss.cli}</version>
                       </dependency>
                       </dependencies>
                       </plugin>
                    </plugins>
                    pluginManagement>