jenkins------部署项目到jboss eap下

  • 添加org.jboss.as.plugins插件

    • 配置pwd,这里我把它配置在maven conf下的settings.xml下了

               <profile>
                  <id>jboss</id>
                  <activation>
                      <activeByDefault>true</activeByDefault>
                  </activation>
                  <properties>
                      <jboss.pwd>123456@admin</jboss.pwd>
                  </properties>
              </profile>
    • 配置部分jboos属性

      <jboss.deploy.hostname>localhost</jboss.deploy.hostname>
      <jboss.deploy.user>admin</jboss.deploy.user>
      <jboss.deploy.pass>${jboss.pwd}</jboss.deploy.pass>
      <jboss.deploy.group>wsite-group</jboss.deploy.group>
    • 配置jboos maven插件(该配置还不完善,需要花时间再研究下)

        <plugin>
            <groupId>org.jboss.as.plugins</groupId>
            <artifactId>jboss-as-maven-plugin</artifactId>
            <version>7.7.Final</version>
            <configuration>
                <force>true</force>
                <hostname>${jboss.deploy.hostname}</hostname>
                <username>${jboss.deploy.user}</username>
                <password>${jboss.deploy.pass}</password>
                <filename>${project.build.finalName}.war</filename>
                <domain>
                    <server-groups>
                        <server-group>wsite-group</server-group>
                    </server-groups>
                </domain>
            </configuration>
            <executions>
      <!--          <execution>
                    <id>jboss-undeploy-maven</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>undeploy</goal>
                    </goals>
                    <configuration>
                        <name>${project.name}</name>
                    </configuration>
                </execution>
                <execution>
                    <id>jboss-deploy-maven</id>
                    <phase>deploy</phase>
                    <goals>
                        <goal>execute-commands</goal>
                    </goals>
                    <configuration>
                        <execute-commands>
                            <batch>true</batch>
                            <commands>
                                <command><![CDATA[/deployment=${project.build.finalName}:add(runtime-name="${project.build.finalName}",content=[{"path"=>"${project.build.finalName}.war","archive"=>false}])]]></command>
                                <command><![CDATA[/server-group=${jboss.deploy.group}/deployment=${project.build.finalName}:add(enabled="true")]]></command>
                            </commands>
                        </execute-commands>
                    </configuration>
                </execution>-->
            </executions>
        </plugin>
  • 执行命令:jboss-as:undeploy jboss-as:deploy -Dmaven.test.skip=true

  • jenkins自动化部署参见jenkins自动化部署

你可能感兴趣的:(maven,jboss,Jenkins)