Loading...
вівторок, 30 квітня 2013 р.

Maven build and deploy to jBoss sample pom.xml

Maven build and deploy to jBoss sample pom.xml
Works with maven 2.2.1 and jBoss 5.1.0, but there are 2 problems:
1. JMX deployment used, so server must be running
2. Undeployment does not work - may be due to some bug in deployer. So needs server restart :(

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<!-- Basic Properties -->
<modelVersion>4.0.0</modelVersion>
<groupId>com.developerscrappad</groupId>
<artifactId>JSONServlet</artifactId>
<version>1.0-SNAPSHOT</version>
<name>JSONServlet</name>

<!-- The absolute path to the JBoss Server, please change this... -->
<properties>
<jboss.directory>d:/jBoss510</jboss.directory>
</properties>

<packaging>war</packaging>

<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>

<!-- maven-war-plugin here -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>src/main/webapp</directory>
<filtering>true</filtering>
<includes>
<include>-web.xml</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>

<!-- JBoss App Server -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<version>1.5.0</version>
<executions>
<execution>
<id>jboss-undeploy</id>
<goals>
<goal>hard-undeploy</goal>
</goals>
<phase>clean</phase>
</execution>
<execution>
<id>jboss-deploy</id>
<goals>
<goal>deploy</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
<configuration>
<jbossHome>${jboss.directory}</jbossHome>
<serverName>default</serverName>
<hostName>localhost</hostName>
<port>8080</port>
<fileNames>
<fileName>${project.build.directory}/${project.build.finalName}</fileName>
</fileNames>
</configuration>

</plugin>
</plugins>
</build>

</project>

0 коментарі:

 
TOP