1.) By adding jboss-web.xml in your web project WEB-INF folder;
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.jboss.com/xml/ns/javaee
http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd">
<context-root>/</context-root>
</jboss-web>
2.) Adding application.xml in your ear's META-INF folder:
<?xml version="1.0" encoding="UTF-8"?>
<application version="5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/application_5.xsd">
<module>
<ejb>czetsuya-ejb.jar</ejb>
</module>
<module>
<web>
<web-uri>czetsuya.war</web-uri>
<context-root>/</context-root>
</web>
</module>
</application>
3.) In your ear's pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>${version.ear.plugin}</version>
<configuration>
<!-- Tell Maven we are using Java EE 6 -->
<version>6</version>
<!-- Use Java EE ear libraries as needed. Java EE ear libraries are
in easy way to package any libraries needed in the ear, and automatically
have any modules (EJB-JARs and WARs) use them -->
<defaultLibBundleDir>lib</defaultLibBundleDir>
<modules>
<webModule>
<groupId>com.kbs</groupId>
<artifactId>czetsuya-web</artifactId>
<contextRoot>/</contextRoot>
</webModule>
</modules>
<fileNameMapping>no-version</fileNameMapping>
</configuration>
</plugin>
0 nhận xét:
Đăng nhận xét