简体   繁体   English

如何使用Maven将.jar文件部署到JBoss EAP6服务器?

[英]How to deploy .jar file to JBoss EAP6 server using Maven?

I have a maven EJB projet whitch i want to deploy by maven command. 我有一个maven EJB projet我希望通过maven命令部署。 I can take the jar of that projet and put it into the folder deployement of my jboss server but i want to do that by maven. 我可以拿那个项目的jar并把它放到我的jboss服务器的文件夹部署中,但我想通过maven做到这一点。 I made some searchs and i found : 我做了一些搜索,我发现:

In the goals i can make : jboss-as:deploy. 在我可以做的目标:jboss-as:deploy。

In the pom.xml: 在pom.xml中:

<plugin>
    <groupId>org.jboss.as.plugins</groupId>
    <artifactId>jboss-as-maven-plugin</artifactId>
    <configuration>
        <filename>${artifactId}-${project.version}.jar</filename>                      
    </configuration>                
</plugin>

The errors whitch gives me are: 错误给我的错误是:

[ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.7.Final:deploy (default-cli) on project myapp: Could not execute goal deploy on D:\\workspaces\\myapp\\target\\myprojet-0.0.1.jar. [错误]无法执行目标org.jboss.as.plugins:jboss-as-maven-plugin:7.7.Final:在项目myapp上部署(default-cli):无法在D:\\ workspaces \\ myapp \\上执行目标部署目标\\ myprojet-0.0.1.jar。 Reason: I/O Error could not execute operation '{ [ERROR] "operation" => "read-attribute", [ERROR] "address" => [], [ERROR] "name" => "launch-type" [ERROR] }': java.net.ConnectException: JBAS012144: Could not connect to remote://localhost:9999. 原因:I / O错误无法执行操作'{[ERROR]“operation”=>“read-attribute”,[ERROR]“address”=> [],[ERROR]“name”=>“launch-type” [ERROR]}':java.net.ConnectException:JBAS012144:无法连接到remote:// localhost:9999。 The connection timed out 连接超时

This is a part of the standalone.xml: 这是standalone.xml的一部分:

enter  <interfaces>
    <interface name="management">
        <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
    </interface>
    <interface name="public">
        <inet-address value="${jboss.bind.address:127.0.0.1}"/>
    </interface>
    <interface name="unsecure">
        <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
    </interface>
</interfaces>

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
    <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9998}"/>
    <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9999}"/>
    <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
    <socket-binding name="ajp" port="8009"/>
    <socket-binding name="http" port="8080"/>
    <socket-binding name="https" port="8443"/>
    <socket-binding name="remoting" port="4447"/>
    <socket-binding name="txn-recovery-environment" port="4712"/>
    <socket-binding name="txn-status-manager" port="4713"/>
    <outbound-socket-binding name="mail-smtp">
        <remote-destination host="localhost" port="25"/>
    </outbound-socket-binding>
</socket-binding-group>

I have a local Jboss Server. 我有一个本地Jboss服务器。 and i tried this (in the pom): 我试过这个(在pom中):

<plugin>
            <groupId>org.jboss.as.plugins</groupId>
            <artifactId>jboss-as-maven-plugin</artifactId>
            <version>7.5.Final</version>
            <configuration>
                <filename>${artifactId}-${project.version}.jar</filename>
                <username>test1</username>
                <password>Pass9584</password>
            </configuration>
</plugin>

It looks like you changed the native management port to 9998 . 看起来您将本机管理端口更改为9998 That's what the plugin uses to connect to the server for management operations. 这就是插件用于连接到服务器以进行管理操作的内容。

 <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9998}"/>

You'll need to add <port>9998</port> to your plugin configuration. 您需要将<port>9998</port>到插件配置中。

<plugin>
    <groupId>org.jboss.as.plugins</groupId>
    <artifactId>jboss-as-maven-plugin</artifactId>
    <version>7.5.Final</version>
    <configuration>
        <filename>${artifactId}-${project.version}.jar</filename>
        <port>9998</port>
    </configuration>
</plugin>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM