Sheel
Sheel

Reputation: 1030

Deploying webapp with maven-wildfly plugin, deploy war under deployment directory

I am using wildfly-maven-plugin for deploying webapp to Wildfly 8.1. Using wildfly:deploy goal, and webapp get deployed somewhere in wildfly directory. Following are my pom.xml and server.log.

<build>
        <plugins>             
            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <version>1.0.2.Final</version> // Also tried latest one.
                <configuration>
                    <jbossHome>/home/me/jboss/</jbossHome>
                    <server-args>
                        <server-arg>-Djboss.server.base.dir=/home/me/jboss/standalone/</server-arg>
                        <server-arg>-b=0.0.0.0</server-arg>
                    </server-args>
                </configuration>
            </plugin>
        </plugins>
</build>

My small part of server.log

13:55:22,418 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "MyApp-1.0-SNAPSHOT.war" (runtime-name : "MyApp-1.0-SNAPSHOT.war")
13:55:22,671 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
13:55:22,672 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
13:55:22,672 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.1.0.Final "Kenny" started in 60324ms - Started 668 of 722 services (93 services are lazy, passive or on-demand)

But my /standalone/deployment/ directory is blank, also no hidden files. So where this thing get deployed !! And also deleted all war files from target and .m2 directory.

Webapp entry in standalone.xml

<deployments>
    <deployment name="MyApp-1.0-SNAPSHOT.war" runtime-name="MyApp-1.0-SNAPSHOT.war">
            <content sha1="c9f1534c910dacdf6789ed585ae17cef73cfbe44"/>
    </deployment>
</deployments>

So I need to deploy war file under /standalone/deployments/ directory.

Upvotes: 4

Views: 4847

Answers (2)

Ashish
Ashish

Reputation: 1917

To deploy your application under standalone directory, you need to copy it to that path. The configuration can be done from pom.xml as below:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <executions>
        <execution>
            <id>copy-war</id>
            <phase>install</phase>
            <goals>
                <goal>copy</goal>
            </goals>
            <configuration>
                <artifactItems>
                    <artifactItem>
                        <groupId>${project.groupId}</groupId>
                        <artifactId>${project.artifactId}</artifactId>
                        <version>${project.version}</version>
                        <type>${project.packaging}</type>
                        <overWrite>true</overWrite>
                        <outputDirectory>\home\me\jboss\standalone\deployments</outputDirectory>
                        <destFileName>${project.build.finalName}.${project.packaging}</destFileName>
                    </artifactItem>
                </artifactItems>
            </configuration>
        </execution>
    </executions>
</plugin>

Upvotes: 1

Dagriel
Dagriel

Reputation: 574

The Maven WildFly Plugin deploys the application through the administration interface (by default running on port 9990). The deployment always goes into the directory standalone/tmp.

The alternative for deployment to /standalone/deployments/ directory is copying the application war directly to it.

Upvotes: 3

Related Questions