战争与耳朵内的罐子之间进行交流 [英] communicate between wars and jar inside ear

查看:74
本文介绍了战争与耳朵内的罐子之间进行交流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不熟悉在战争和罐子之间建立耳朵和交流...

I'm new to creating ear and communicaton between wars and jar...

我有两次战争具有完全独立的功能. 现在,我必须创建一个Ear,其中两个应用程序必须使用相同的功能, 但这是必须的,我必须不要在两个的Pom.xml中都包含该罐子,而是要使用该罐子,因为这三个罐子都放在单个耳朵下,这可能吗? 我已经通过2次独立的战争测试了Ear,现在如何在上面实现目标仍可以正常工作.
我正在将Maven与Jboss7.1.1.一起使用. 我通过了 JAR/WAR/EAR中的MessageHandler https://stackoverflow.com/questions/1796255/tell-me-a -clear-differnece-ween-ear-war-and-jar ,但对上述问题一无所知.

I was having two wars having completely independent functionality. Now I've to create a Ear, where two application have to work on same functionality, which is enclosed in a jar.But requirement is I must not include the jar in Pom.xml of both but make use of that jar, where all 3 are under single ear.is this is possible? I've tested Ear with 2 independent wars and it's working fine now how to achieve above I'm not getting this.
I'm using Maven with Jboss7.1.1.
I went through links like MessageHandler in JAR/WAR/EAR , https://stackoverflow.com/questions/1796255/tell-me-a-clear-differnece-between-ear-war-and-jar but got no idea about above problem.

推荐答案

Hi got the solution >> here it is.. this is a pom.xml of ear project


<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">
  <modelVersion>4.0.0</modelVersion>
  <groupId>Test</groupId>
  <artifactId>Test</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>ear</packaging> 

<dependencies>
    <!--Dependency for jar-->
    <dependency>
        <groupId>com.jar</groupId>
        <artifactId>com.jar</artifactId>
        <version>1.0</version>
        <type>war</type>
    </dependency>
    <!--Dependency for war1-->
    <dependency>
        <groupId>com.war2</groupId>
        <artifactId>com.war2</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <type>war</type>
    </dependency>       
    <!--Dependency for war2-->  
    <dependency>
        <groupId>com.war1</groupId>
        <artifactId>com.war1</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <type>war</type>
    </dependency>
</dependencies>

<build>
    <finalName>Project</finalName>
    <plugins>
        <plugin>
            <artifactId>maven-ear-plugin</artifactId>
            <version>2.8</version>
            <configuration>
                <finalName>MyEarFile</finalName>
                <version>5</version>
                <modules>
                    <!--Webmodule for war1-->
                    <webModule>
                        <groupId>com.war1</groupId>
                        <artifactId>com.war1</artifactId>
                        <uri>war1.war</uri>
                        <bundleFileName>war1.war</bundleFileName>
                    </webModule>

                    <!--Webmodule for war2-->
                    <webModule>
                        <groupId>com.war2</groupId>
                        <artifactId>com.war2</artifactId>
                        <uri>war2.war</uri>
                        <bundleFileName>war2.war</bundleFileName>
                    </webModule>
                </modules>
            </configuration>
        </plugin>
    </plugins>
  </build>
</project>




Note:: groupId and artifactId metioned here must match with groupId and artifactId mentioned in the project's pom.xml.
Also dependency of jar must be present in this i.e. ear's pom.xml and not in both app's pom.xml.
At time of maven install it automatically refers to jar's contents..

这篇关于战争与耳朵内的罐子之间进行交流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆