wildfly-maven-plugin不会部署任何东西 [英] wildfly-maven-plugin doesn't deploy anything

查看:136
本文介绍了wildfly-maven-plugin不会部署任何东西的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望Maven启动一个Wildfly服务器,该服务器可在我的目标文件夹中的/path/to/project/target/wildfly-8.1.2-Final中找到.该插件应该在集成前测试阶段部署战争产物.这种伪像是在包装阶段由maven-war-plugin创建的,恰好在wildfly-maven-plugin启动之前.

I would like Maven to start up a wildfly server which is available in my target-folder at /path/to/project/target/wildfly-8.1.2-Final. The plugin is supposed to deploy a war-artifact during pre-integration-test phase. That very artifact was created by maven-war-plugin during package-phase right before wildfly-maven-plugin starts.

运行Maven构建时,wildfly会启动,但是不会部署任何东西.它只是在启动后挂起,并且让Maven构建在60秒的超时后失败...

When running the maven build, wildfly starts up, however does not deploy anything. It just hangs after starting up and lets the Maven build fail after a timeout of 60 seconds...

这是我有效的pom:

<plugin>
    <groupId>org.wildfly.plugins</groupId>
    <artifactId>wildfly-maven-plugin</artifactId>
    <version>1.1.0.Alpha8</version>
    <executions>
      <execution>
        <phase>pre-integration-test</phase>
        <goals>
          <goal>start</goal>
          <goal>deploy</goal>
        </goals>
        <configuration>
          <port>18080</port>
          <timeout>60</timeout>
          <skip>false</skip>
          <hostname>127.0.0.1</hostname>
          <name>/path/to/project/target/my-artifact.war</name>
          <targetDir>/path/to/project/target/wildfly-8.2.1.Final/standalone/deployments</targetDir>
          <server-config>standalone.xml</server-config>
          <username>wildfly-test</username>
          <password>wildfly.1234</password>
          <add-user>
            <users>
              <user>
                <username>wildfly-admin</username>
                <password>wildfly.1234</password>
                <groups>
                  <group>admin</group>
                  <group>user</group>
                </groups>
                <application-user>false</application-user>
                <realm>ManagementRealm</realm>
              </user>
              <user>
                <username>wildfly-test</username>
                <password>wildfly.1234</password>
                <groups>
                  <group>user</group>
                </groups>
                <application-user>true</application-user>
                <realm>ApplicationRealm</realm>
              </user>
            </users>
          </add-user>
        </configuration>
      </execution>
      <execution>
        <phase>post-integration-test</phase>
        <goals>
          <goal>undeploy</goal>
          <goal>shutdown</goal>
        </goals>
        <configuration>
          <hostname>127.0.0.1</hostname>
          <port>18888</port>
          <skip>false</skip>
          <name>/path/to/project/target/my-artifact.war</name>
          <targetDir>/path/to/project/target/wildfly-8.2.1.Final/standalone/deployments</targetDir>
          <server-config>standalone.xml</server-config>
          <username>wildfly-test</username>
          <password>wildfly.1234</password>
          <add-user>
            <users>
              <user>
                <username>wildfly-admin</username>
                <password>wildfly.1234</password>
                <groups>
                  <group>admin</group>
                  <group>user</group>
                </groups>
                <application-user>false</application-user>
                <realm>ManagementRealm</realm>
              </user>
              <user>
                <username>wildfly-test</username>
                <password>wildfly.1234</password>
                <groups>
                  <group>user</group>
                </groups>
                <application-user>true</application-user>
                <realm>ApplicationRealm</realm>
              </user>
            </users>
          </add-user>
        </configuration>
      </execution>
    </executions>
    <configuration>
      <skip>false</skip>
      <hostname>127.0.0.1</hostname>
      <port>18080</port>
      <name>/path/to/project/target/my-artifact.war</name>
      <targetDir>/path/to/project/target/wildfly-8.2.1.Final/standalone/deployments</targetDir>
      <server-config>standalone.xml</server-config>
      <username>wildfly-test</username>
      <password>wildfly.1234</password>
      <add-user>
        <users>
          <user>
            <username>wildfly-admin</username>
            <password>wildfly.1234</password>
            <groups>
              <group>admin</group>
              <group>user</group>
            </groups>
            <application-user>false</application-user>
            <realm>ManagementRealm</realm>
          </user>
          <user>
            <username>wildfly-test</username>
            <password>wildfly.1234</password>
            <groups>
              <group>user</group>
            </groups>
            <application-user>true</application-user>
            <realm>ApplicationRealm</realm>
          </user>
        </users>
      </add-user>
    </configuration>
  </plugin>

有人经历过类似的行为吗?

Has anybody experienced a similar behaviour?

也许有人可以给我指出这里出问题的地方...任何帮助都将受到高度赞赏.

Maybe somebody could give me a pointer on what is wrong here... Any help is highly appreciated.

谢谢 沃尔特

推荐答案

阅读文档后,我可以知道不清楚<port/>的用途. port配置属性用于告诉插件管理界面正在侦听哪个端口.这就是为什么使用端口9990起作用的原因.与<hostname/>相同.

After reading the documentation I can tell it's not clear what <port/> is used for. The port configuration property is used to tell the plugin which port the management interface is listening on. That is why using port 9990 works. Same with the <hostname/>.

<targetDir/>似乎也是错误的.它的名字不好用,但是该目录用于查找部署.本质上,这是maven将编译后的归档文件放在其中的目标目录.

The <targetDir/> seems to be wrong as well. It's poorly named, but that directory is used find the deployment. Essentially it's the target directory where maven put the compiled archive.

在查看配置时,您将定义许多不必要的默认值.以下是您发布的示例中的插件配置的简化版本示例.

Looking at the configuration you're defining a lot of the defaults that shouldn't be necessary. Below is an example stripped down version of the plugin configuration from the example you posted.

<plugin>
  <groupId>org.wildfly.plugins</groupId>
  <artifactId>wildfly-maven-plugin</artifactId>
  <version>1.1.0.Alpha8</version>
  <executions>
    <execution>
      <phase>pre-integration-test</phase>
      <goals>
        <goal>start</goal>
        <goal>deploy</goal>
      </goals>
      <configuration>
        <add-user>
          <users>
            <user>
              <username>wildfly-admin</username>
              <password>wildfly.1234</password>
              <groups>
                <group>admin</group>
                <group>user</group>
              </groups>
              <application-user>false</application-user>
              <realm>ManagementRealm</realm>
            </user>
            <user>
              <username>wildfly-test</username>
              <password>wildfly.1234</password>
              <groups>
                <group>user</group>
              </groups>
              <application-user>true</application-user>
              <realm>ApplicationRealm</realm>
            </user>
          </users>
        </add-user>
      </configuration>
    </execution>
    <execution>
      <phase>post-integration-test</phase>
      <goals>
        <goal>undeploy</goal>
        <goal>shutdown</goal>
      </goals>
    </execution>
  </executions>
</plugin>

这篇关于wildfly-maven-plugin不会部署任何东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆