简体   繁体   中英

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. 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. I made some searchs and i found :

In the goals i can make : jboss-as:deploy.

In the 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. 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. The connection timed out

This is a part of the 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. and i tried this (in the 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 . 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.

<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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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