Dave
Dave

Reputation: 19090

Why is my WAR file not showing up on JBoss using the jboss-maven-plugin?

I'm running a JBoss 4.2.3.GA app server (can't change this sadly) and building a WAR project with Maven 3.0.3. I'm trying to deploy my WAR file to the remote JBoss server using the jboss-maven-plugin. Although Maven doesn't report any errors when I execute my build, the WAR file never shows up in my $JBOSS_HOME/server/default/deploy directory. Here's the configuration I'm using in my pom.xml file …

        <!-- Deploy app to remote JBoss instance -->
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jboss-maven-plugin</artifactId>
            <version>1.5.0</version>
            <configuration>
                <serverId>default</serverId>
                <hostName>localhost</hostName>
                <port>8080</port>
                <fileNames>
                    <fileName>${project.basedir}/target/${project.artifactId}-${project.version}.war</fileName>
                </fileNames>
            </configuration>
            <executions>
                <execution>
                    <phase>install</phase>
                    <goals>
                        <goal>deploy</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

In my ~/.m2/settings.xml file, I have

<servers>
    <server>
        <id>default</id>
        <username>admin</username>
        <password>admin</password>
    </server>
</servers>

where the username and password are the un/pw defined for accessing my jmx-console. Below is the output from Maven. Notice no errors are reported. WHat else should I check to figure out why my WAR isn't getting deployed?

[INFO] --- jboss-maven-plugin:1.5.0:deploy (default) @ myclient ---
[DEBUG] org.codehaus.mojo:jboss-maven-plugin:jar:1.5.0:
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0.11:compile
[DEBUG]    org.apache.maven:maven-artifact-manager:jar:2.0.11:compile
[DEBUG]       org.apache.maven:maven-repository-metadata:jar:2.0.11:compile
[DEBUG]       org.apache.maven:maven-artifact:jar:2.0.11:compile
[DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[DEBUG]          junit:junit:jar:3.8.2:test (scope managed from compile) (version managed from 3.8.1)
[DEBUG]          classworlds:classworlds:jar:1.1-alpha-2:compile
[DEBUG]    org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2:compile
[DEBUG]    commons-codec:commons-codec:jar:1.3:compile
[DEBUG]    jboss:jboss-jmx:jar:4.0.2:compile
[DEBUG]    jboss:jnp-client:jar:4.0.2:compile
[DEBUG]    jboss:jboss-common:jar:4.0.2:compile
[DEBUG]       slide:webdavlib:jar:2.0:compile
[DEBUG]       xerces:xercesImpl:jar:2.6.2:compile
[DEBUG]    jboss:jbosssx-client:jar:3.2.3:compile
[DEBUG]    velocity:velocity:jar:1.4:compile
[DEBUG]       velocity:velocity-dep:jar:1.4:runtime
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:1.5.15:compile
[DEBUG] Created new class realm plugin>org.codehaus.mojo:jboss-maven-plugin:1.5.0
[DEBUG] Importing foreign packages into class realm plugin>org.codehaus.mojo:jboss-maven-plugin:1.5.0
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.codehaus.mojo:jboss-maven-plugin:1.5.0
[DEBUG]   Included: org.codehaus.mojo:jboss-maven-plugin:jar:1.5.0
[DEBUG]   Included: commons-codec:commons-codec:jar:1.3
[DEBUG]   Included: jboss:jboss-jmx:jar:4.0.2
[DEBUG]   Included: jboss:jnp-client:jar:4.0.2
[DEBUG]   Included: jboss:jboss-common:jar:4.0.2
[DEBUG]   Included: slide:webdavlib:jar:2.0
[DEBUG]   Included: xerces:xercesImpl:jar:2.6.2
[DEBUG]   Included: jboss:jbosssx-client:jar:3.2.3
[DEBUG]   Included: velocity:velocity:jar:1.4
[DEBUG]   Included: velocity:velocity-dep:jar:1.4
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:1.5.15
[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0.11
[DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.11
[DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.11
[DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0.11
[DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
[DEBUG]   Excluded: junit:junit:jar:3.8.2
[DEBUG]   Excluded: classworlds:classworlds:jar:1.1-alpha-2
[DEBUG]   Excluded: org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2
[DEBUG] Configuring mojo org.codehaus.mojo:jboss-maven-plugin:1.5.0:deploy from plugin realm    ClassRealm[plugin>org.codehaus.mojo:jboss-maven-plugin:1.5.0, parent: sun.misc.Launcher$AppClassLoader@20cf2c80]
[DEBUG] Configuring mojo 'org.codehaus.mojo:jboss-maven-plugin:1.5.0:deploy' with basic configurator -->
[DEBUG]   (f) fileNameEncoding = UTF-8
[DEBUG]   (f) fileNames = [/Users/davea/Dropbox/workspace/myclient/target/myclient-1.0-SNAPSHOT.war]
[DEBUG]   (f) hostName = localhost
[DEBUG]   (f) port = 8080
[DEBUG]   (f) serverId = default
[DEBUG]   (f) skip = false
[DEBUG] -- end configuration --
[INFO] Deploying /Users/davea/Dropbox/workspace/myclient/target/myclient-1.0-SNAPSHOT.war to JBoss.
[DEBUG] url = http://localhost:8080/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service %3DMainDeployer&methodName=deploy&argType=java.net.URL&arg0=%2FUsers%2Fdavea%2FDropbox%2Fworkspace%2Fmyclient%2Ftarget%2Fmyclient-1.0-SNAPSHOT.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

Upvotes: 1

Views: 1559

Answers (1)

DevCat
DevCat

Reputation: 113

Here is my jboss-maven-plugin configuration. With this configuration I am able to deploy my war application without problems. Take a look at the fileName path.

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jboss-maven-plugin</artifactId>
    <version>1.5.0</version>
    <!-- JMX credentials defined in ~/.m2/settings.xml -->
    <configuration>
        <hostName>10.0.16.14</hostName> <!-- either an IP address or localhost -->
        <port>8280</port>
        <serverId>jboss-dev</serverId>
        <fileNames>
            <fileName>../server/default/deploy/myApp.war</fileName>
        </fileNames>
    </configuration>
</plugin>

My ~/.m2/settings.xml server is like:

<servers>
    <server>
        <id>jboss-dev</id>
        <username>admin</username>
        <password>admin</password>
    </server>
</servers>

Upvotes: 1

Related Questions