maven 开发 ejb ear

maven新建ejb maven 新建EJB测试项目和web项目客户端测试session bean 查找 立即下载

基于EJB开发业务简介

在复杂的企业IT架构中 web模块主要用途其实在展现层,它接收到用户的请求后委托后端的 ejb 完成业务逻辑(将业务交由ejb处理,可方便地获得保障业务事务及分布式事务、多客户端调用等好处),然后将ejb的处理结果以可视化形式展现给用户,如此的分层架构可以方便地对ejb业务层实施可复用和分布式。


ejb通常都是jar文件,web通常是war文件,一般都是独立部署,但是,有的时候我们也希望将某些ejb和web打包的一起部署,这就是企业应用ear。


maven 支持 ear 的管理。


假设要完成的ear中包行一个ejb和一个web,名称分别为:ejb3和webdemo,两个模块独立开发完成后执行 install 安装到本地maven库,建立一个ear模块(其实就是普通的maven项目,只是设置pom打包类型<packaging>ear</packaging>),如果要开发一个ejb,那么就设置<packaging>ejb</packaging>。


1.开发一个ejb

名称ejb3,其pom大致为:

<?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">
    <parent>
        <artifactId>eden</artifactId>
        <groupId>com.conquer.eden</groupId>
        <version>1.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <packaging>ejb</packaging>

    <artifactId>ejb3</artifactId>

    <dependencies>
        <dependency>
            <groupId>javax.ejb</groupId>
            <artifactId>ejb-api</artifactId>
            <version>3.0</version>
            <scope>provided</scope>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>org.eclipse.persistence</groupId>-->
            <!--<artifactId>javax.persistence</artifactId>-->
            <!--<version>2.0.5</version>-->
            <!--<scope>provided</scope>-->
        <!--</dependency>-->
    </dependencies>
    <build>
        <finalName>${artifactId}</finalName>
        <plugins>
            <plugin>
                <!--<groupId>org.apache.maven.plugins</groupId>-->
                <artifactId>maven-ejb-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <ejbVersion>3.0</ejbVersion>

                    <!--<filterDeploymentDescriptor>true</filterDeploymentDescriptor>-->

                    <!-- this is false by default -->
                    <generateClient>true</generateClient>
                    <!--用下面的方式进行 客户端生成定制-->
                    <clientIncludes>
                        <!-- 包含 test 下面的所有文件和文件夹 -->
                        <!--<clientInclude>test/**</clientInclude>-->
                        <!-- 包含 com/example 下面所有的文件,PS:不含文件夹-->
                        <!--<clientInclude>com/example/*</clientInclude>-->
                    </clientIncludes>
                    <clientExcludes>
                        <!-- 不包含 com/example 下的所有文件-->
                        <!--<clientExclude>com/example/*</clientExclude>-->
                        <!-- this will exclude all files and directories with the name sparrow under com/jack -->
                        <!--<clientExclude>com/jack/**/sparrow</clientExclude>-->
                    </clientExcludes>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

以上的pom文件需要注意的点:

1.打包类型:

<packaging>ejb</packaging>
2.EJB插件

<artifactId>maven-ejb-plugin</artifactId>
3.是否生成EJB客户端jar

<generateClient>true</generateClient>

关于<generateClient>的介绍:

<generateClient>用于生成简单版的ejb客户端,通常只包含客户端使用到的接口而不包含实现类,

他的默认排除规则是:

  • **/*Bean.class
  • **/*CMP.class
  • **/*Session.class
  • **/package.html
所以加入我们的实现类是以Bean结尾的话,在打包成的*-client.jar中会自动去除,

当然,该规则也可以定制,可以定制需要添加和排除的文件,如下:

        <configuration>
          <clientIncludes>
             <!-- this will include all files and directories under com/foo/bar -->
             <clientInclude>com/foo/bar/**</clientInclude>
             <!-- this will include all files and directories under com/foo/acme -->
             <clientInclude>com/foo/acme/**</clientInclude>
             <!-- this will include all files under com/example -->
             <clientInclude>com/example/*</clientInclude>
          </clientIncludes>
          <clientExcludes>
             <!-- this will exclude all files under com/example -->
             <clientExclude>com/example/*</clientExclude>
             <!-- this will exclude all files and directories with the name
                  sparrow under com/jack -->
             <clientExclude>com/jack/**/sparrow</clientExclude>
          </clientExcludes>
        </configuration>

最后:在模块中添加此client的依赖时候,其类型要指定为ejb-client,如
<dependency>
    <groupId>com.conquer.eden</groupId>
    <artifactId>xaejb</artifactId>
    <version>1.0</version>
    <!--<classifier>client</classifier>-->
    <type>ejb-client</type>
</dependency>

官网参考:

http://maven.apache.org/plugins/maven-ejb-plugin/

http://maven.apache.org/plugins/maven-ejb-plugin/examples/generating-ejb-client.html

ejb的java代码:

public interface TestDAOEJB {
    String insertData(String data) throws Exception;
    String insertData2(String data) throws Exception;
    String insertData3(String data) throws Exception;
}
import javax.ejb.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;
import java.io.IOException;
import java.sql.Connection;
import java.sql.Statement;
import java.util.Properties;

//@Stateless
//@Stateless(mappedName = "TestDAOBean")
@Stateful
@Remote(value = TestDAOEJB.class)
public class TestDAOBean implements TestDAOEJB {

    private static String otherNode1;
    private static String otherNode2;
    static {
        try {
            Properties properties = new Properties();
            properties.load(TestDAOBean.class.getResourceAsStream("/config.properties"));
            otherNode1 = properties.getProperty("otherNode1");
            otherNode2 = properties.getProperty("otherNode2");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    /**
     * CREATE TABLE wangpl(name VARCHAR2(200))
     */

    @Override
    @TransactionAttribute(TransactionAttributeType.REQUIRED)//这是默认值,可以省略,或修改为其它事务策略
    public String insertData(String data) throws Exception {
        String returnString = "insertData-OK";
        Connection con = null;
        Statement statement = null;
        try {
            DataSource dataSource = (DataSource) new InitialContext().lookup("DataSource1");
            con = dataSource.getConnection();
            statement = con.createStatement();
            String sql = "INSERT INTO wangpl VALUES('" + data + ":insertData')";
            statement.execute(sql);
        } finally {
            // close xxx
        }

        // 调用远程节点
        Properties p = new Properties();
        p.put(Context.INITIAL_CONTEXT_FACTORY, "com.xxx.RemoteInitialContextFactory");
        p.put(Context.PROVIDER_URL, otherNode1);
        InitialContext ctx = new InitialContext(p);
        TestDAOEJB remote = (TestDAOEJB) ctx.lookup("TestDAOBeanRemote");
        remote.insertData2(data + "1");

        return returnString;
    }
    @Override
    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
    public String insertData2(String data) throws Exception {
        String returnString = "insertData2-OK";
        Connection con = null;
        Statement statement = null;
        try {
            DataSource dataSource = (DataSource) new InitialContext().lookup("DataSource1");
            con = dataSource.getConnection();
            statement = con.createStatement();
            String sql = "INSERT INTO wangpl VALUES('" + data + ":insertData2')";
            statement.execute(sql);
        } finally {
            // close xxx
        }

        // 调用远程ejb
        Properties p = new Properties();
        p.put(Context.INITIAL_CONTEXT_FACTORY, "com.xxx.RemoteInitialContextFactory");
        p.put(Context.PROVIDER_URL, otherNode2);
        InitialContext ctx = new InitialContext(p);
        TestDAOEJB remote = (TestDAOEJB) ctx.lookup("TestDAOBeanRemote");
        remote.insertData3(data + "1");

        if (data.equals("11")) {
            throw new RuntimeException("************* Runtime Exception **************");
        }
        return returnString;
    }
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public String insertData3(String data) throws Exception {
        String returnString = "insertData3-OK";
        Connection con = null;
        Statement statement = null;
        try {
            DataSource dataSource = (DataSource) new InitialContext().lookup("DataSource1");
            con = dataSource.getConnection();
            statement = con.createStatement();
            String sql = "INSERT INTO wangpl VALUES('" + data + ":insertData3')";
            statement.execute(sql);
        } finally {
            // close xxx
        }

        if (data.equals("211")) {
            throw new RuntimeException("************* Runtime Exception **************");
        }

        return returnString;
    }
}

2.开发web模块

其pom大致如下:

<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/maven-v4_0_0.xsd">
    <parent>
        <artifactId>eden</artifactId>
        <groupId>com.conquer.eden</groupId>
        <version>1.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>webdemo</artifactId>
    <packaging>war</packaging>
    <name>webdemo</name>
    <build>
        <finalName>${artifactId}</finalName>
    </build>
    <dependencies>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.conquer.eden</groupId>
            <artifactId>ejb3</artifactId>
            <version>1.0</version>
            <!--<classifier>client</classifier>-->
            <type>ejb-client</type>
         </dependency>
    </dependencies>
</project>
以上pom,要注意的是添加ejb的client依赖,指明类型是:<type>ejb-client</type>

web层业务代码 ,可以使用 @EJB  @Resource 的注解方式,或者手工: new InitialContext(xx)来访问ejb。


3.开发ear

其pom文件为:

<?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">
    <parent>
        <artifactId>eden</artifactId>
        <groupId>com.conquer.eden</groupId>
        <version>1.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <packaging>ear</packaging>

    <artifactId>ear</artifactId>

    <dependencies>
        <dependency>
            <groupId>com.conquer.eden</groupId>
            <artifactId>ejb3</artifactId>
            <version>1.0</version>
            <type>ejb</type>
        </dependency>
        <dependency>
            <groupId>com.conquer.eden</groupId>
            <artifactId>webdemo</artifactId>
            <version>1.0</version>
            <type>war</type>
        </dependency>
    </dependencies>

    <build>
        <finalName>${artifactId}</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-ear-plugin</artifactId>
                <version>2.10</version>
                <configuration>
                    <!--<generateModuleId>true</generateModuleId>-->

                    <!--指定打包范围,避免无用jar混乱加入-->
                    <!--<packagingIncludes>META-INF/**,**/acme-*.jar,**/acme-*.war</packagingIncludes>-->
                    <!--<packagingExcludes></packagingExcludes>-->

                    <!--打包指定目录lib-->
                    <defaultLibBundleDir>lib/</defaultLibBundleDir>
                    <!--将多个war的共享包提取到父级别-->
                    <skinnyWars>true</skinnyWars>

                    <!--<includeLibInApplicationXml>true</includeLibInApplicationXml>-->

                    <!--jboss 定制-->
                    <!--<jboss>-->
                        <!--<version>5</version>-->
                        <!--<module-order>strict</module-order>-->
                        <!--<unauthenticated-principal>guest</unauthenticated-principal>-->
                        <!--<loader-repository>com.foo:loader=foo-application-1.0.ear</loader-repository>-->
                    <!--</jboss>-->

                    <modules>

                        <!--jarModule:用于添加第三方库,配合includeInApplicationXml,可使其像一个开发的模块-->
                        <jarModule>
                            <!--<groupId>com.conquer.eden</groupId>-->
                            <!--<artifactId>ejb3</artifactId>-->
                            <!--<bundleFileName>ejb3.jar</bundleFileName>-->

                            <!--<includeInApplicationXml>true</includeInApplicationXml>-->

                            <!--<bundleDir>APP-INF/lib</bundleDir> 只更改位置,名称保持不变-->
                            <!--<uri>APP-INF/lib/anotherName-1.2.3.jar</uri> 可定制位置和名称,需要指定名称-->
                            <!--<excluded>true</excluded>-->

                            <!--<moduleId>ejb3-id</moduleId>-->
                        </jarModule>
                        <ejbModule>
                            <groupId>com.conquer.eden</groupId>
                            <artifactId>ejb3</artifactId>
                            <bundleFileName>ejb3.jar</bundleFileName>
                        </ejbModule>
                        <webModule>
                            <groupId>com.conquer.eden</groupId>
                            <artifactId>webdemo</artifactId>
                            <bundleFileName>webdemo.war</bundleFileName>

                            <!--<moduleId>webdemo-id</moduleId>-->
                        </webModule>
                    </modules>
                    <!--<security>-->
                        <!--<security-role id="SecurityRole_1234">-->
                            <!--<role-name>manager</role-name>-->
                        <!--</security-role>-->
                        <!--<security-role id="SecurityRole_5678">-->
                            <!--<description>My cool description</description>-->
                            <!--<role-name id="RoleName_12">teller</role-name>-->
                        <!--</security-role>-->
                    <!--</security>-->

                    <!--<version>6</version>-->
                    <!--<env-entries>-->
                        <!--<env-entry>-->
                            <!--<description>A complete entry.</description>-->
                            <!--<env-entry-name>complete</env-entry-name>-->
                            <!--<env-entry-type>java.lang.Integer</env-entry-type>-->
                            <!--<env-entry-value>4</env-entry-value>-->
                        <!--</env-entry>-->
                        <!--<env-entry>-->
                            <!--<env-entry-name>no-type</env-entry-name>-->
                            <!--<env-entry-value>4</env-entry-value>-->
                        <!--</env-entry>-->
                        <!--<env-entry>-->
                            <!--<env-entry-name>no-value</env-entry-name>-->
                            <!--<env-entry-type>java.lang.String</env-entry-type>-->
                        <!--</env-entry>-->
                    <!--</env-entries>-->

                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

以上pom要注意的是:

1.添加的两个依赖一个是ejb,一个是war包,指明的类型分别是:

<type>ejb</type>和<type>war</type>
2.EAR的打包插件

<artifactId>maven-ear-plugin</artifactId>

3.添加的ejb和war需要分别指明:<ejbModule> 和 <webModule> 并且都可以定制打进ear的名称,通过:<bundleFileName>


执行ear模块的package目标或执行ear模块maven的ear:ear可完成 ear的打包工作。

关于 maven-ear-plugin ,官网参考:http://maven.apache.org/plugins/maven-ear-plugin/


eclipse3.6创建EJB+JPA+EAR(每个都是单独工程)完整介绍 eclipse3.6创建EJB+JPA+EAR(每个都是单独工程)完整介绍:自动创建表结构、数据源配置、jpa和ejb工程添加到ear包中。以及注入Emanager。 要这么高的分只是为了物有所值。 立即下载

相关推荐

EJB 打EAR包

NULL 博文链接:https://zgdkik.iteye.com/blog/1821479

Ejb中jar war ear的理解和Local和remote的理解(一)

这半年来公司一直在用EJB3+strust2+JPA进行开发...使用Jboss作为服务器的分布式开发。这里对ejb进行一些了解总结 1.jar,war,ear 1.1 Jar文件 (扩展名为. Jar)我们进行使用一些框架还有java包都是jar后缀的.它存放的是一些可以使.class文件.资源(resources)、辅助文件(auxiliary files)、 配置文件(xml...

java小菜 485

EJB3 maven helloworld项目

EJB3 基于maven项目测试,适合初学者,需要自行瞎子安装jboss5

Maven创建EJB项目HelloWorld使用IDE为eclipse

参考1、 HOW TO CREATE A EJB 3.X PROJECT USING MAVEN IN ECLIPSE – PART 1 http://theopentutorials.com/examples/java-ee/ejb3/how-to-create-a-ejb-3-x-project-using-maven-in-eclipse-part-1/ HOW TO

孤竹的博客 2948

在PyCharm中配置使用Anaconda环境

在PyCharm中配置使用Anaconda环境一、步骤1.Anaconda2.PyCharm总结 一、步骤 1.Anaconda 如未安装Anaconda可至其官网下载,学习使用个人版就可以了。 下载地址:https://www.anaconda.com/products/individual 1、打开Anaconda Navigator,点击Environments可以看到anaconda中已经有了默认的“base”环境,其中包含了大多数我们会用到的包,在PyCharm中可以直接使用该环境,而无需自行下载

TuckX的博客 19万+

Centos7 XFS(dm-0):Internal error XFS_WANT_CORRUPTED_GOTO

在k8s的道路上我们都是小白,每天启动虚机都会遇到各种各样的问题,这不。部署的k8s虚机启动发现操作系统启动异常,提示如下报错信息。进入/dev/mapper目录下,查询目录下路径信息。可以通过对文件系统进行修复操作,操作如下。重启完成后虚机恢复正常登录。

hedao0515的专栏 4583

ejb的maven_针对新手的Java EE7和Maven项目-第3部分-定义ejb服务和jpa实体模块

ejb的maven 从前面的部分恢复 第1部分 第2部分 我们在第三部分继续介绍,我们已经有一个父pom,并且已经为我们的war模块定义了pom。 在我们的原始设置中,我们定义了我们的应用程序将包含一个ejb jar形式的服务jar。 这是我们的Enterprise Java Bean,特别是Session Bean。 我们还定义了另一个模块(层),该模块将托管实体Bean(数据库表示B...

最佳 Java 编程 351

从模型车到真实路口:基于YOLOv5-Lite与SORT的轻量化车流量检测系统实战

本文详细阐述了如何将基于YOLOv5-Lite与SORT的轻量化车流量检测系统从毕业设计原型部署到真实路口。文章聚焦于解决在嵌入式平台(如树莓派)上实现实时、稳定检测的工程挑战,涵盖数据采集、模型微调、系统集成及动态信号灯策略,为智能交通灯系统提供了实用的轻量化解决方案。

weixin_29179311的博客 126

使用 EJB、EAR 模板构建适配器模块的简单步骤

本博客间接地涵盖了所有这些常见步骤,但以 EJB、EAR 项目模板的形式,以简化 Netweaver Developer Studio (NWDS) 中的开发工作

shenchen02的博客 237

机器学习教程 之 半监督学习 Co-training 协同训练 (论文、算法、数据集、代码)

这篇博客介绍的是一篇用于半监督分类问题的方法: 协同训练 Co-training, A. Blum and T. Mitchell, “Combining labeled and unlabeled data with co-training,” in Proc. of the 11th Annual Conf. on Computational Learning Theory, 1998.,这算是半监督领域里面始祖级的论文了,是1998年两位CMU大佬提出的方法。 之前还写过一篇关于Tri-trainin

冯良骏 的 博客 1万+

PyTorch复现PSMNet踩坑全记录:从环境配置到KITTI数据集训练

本文详细记录了使用PyTorch复现CVPR经典立体匹配模型PSMNet的全过程,从环境配置到KITTI数据集训练,特别针对2023年主流软硬件环境中的常见问题提供解决方案。文章重点介绍了PSMNet的金字塔池化模块和堆叠沙漏结构,帮助研究者和工程师快速实现工业级深度估计,节省大量试错时间。

weixin_30897233的博客 328

java ear项目_基础普及-Jar、War、Ear

名词解释Jar文件(扩展名为. Jar)包括Java类的普通库、资源(resources)、辅助文件 (auxiliary files)等War文件(扩展名为.War)包括所有Web应用程序。在这样的情形下,一个Web应用程序被定义为单独的 一组文件、类和资源,用户能够对jar文件进行封装,并把它作为小型服务程序(servlet)来訪问。Ear文件(扩展名为.Ear)包括所有企业应用程序。在这样的...

weixin_42298973的博客 1160

从Datasheet到可用的Verilog模块:手把手教你为N25Q128 SPI Flash写状态机驱动

本文详细介绍了如何从Datasheet到实现可用的Verilog模块,手把手教你为N25Q128 SPI Flash编写状态机驱动。文章涵盖SPI Flash的核心工作机制、数据手册解析方法、Verilog状态机设计实践以及调试与性能优化技巧,特别适合FPGA开发者和硬件设计工程师参考。

weixin_30596023的博客 177

Java技术常见术语及其解释(常见缩写)

Java技术常见术语及其解释(Terminology) Terminology是“术语,专门用语”的意思。Java中有太多的缩写词、技术术语,初学者经常被各个术语搞得晕头转向。下边来汇总一下,希望对大家有所帮助。 JRE 与 JDK JRE: Java运行环境 JRE 是 Java Runtime Environment 缩写,指Java运行环境,是Sun的产品。运行JAVA程序所必须的环境的集合...

我的开发博客(公众号:Web后端技术) 1万+

二十一.基于国民MCU 的增加M4F DSP库调用的验证

Cortex-M4F内核不仅内置硬件FPU单元,还支持多种DSP指令集,比如支持单周期乘加指令(MAC)等。因此Cortex-M4执行所有的DSP指令集都可以在单周期内完成,而Cortex-M3和M0需要多个指令和多个周期才能完成同样的功能。比如开方运算,M3和M0只能通过迭代法(标准数学函数库)计算,而M4F直接调用VSQRT指令完成。参考:\Nationstech.N32G45x_Library.1.1.1\Nationstech.N32G45x_Library.1.1.1\projects\n32g4

AIoT深度探索者 | 嵌入式系统架构师 深耕物联网(IoT)与人工智能(AI)融合技术,聚焦​​边缘计算、图像开发、低功耗通信协议​​,致力于智能硬件,关注我获取最新技术文章信息与海量资源~ 934

价值微笑曲线与AI公司的位置

1. 背景介绍 1.1 问题由来 自20世纪60年代,哈佛大学商学院教授西奥多·波特提出了“价值链”理论以来,企业如何构建竞争优势成为企业经营管理领域的研究重点。随着全球化的发展和科技进步,企业竞争环境发生了深刻变化,传统价值链管理模式逐渐显现出局限性。近年来,全球竞争格局由成本竞争转向创新竞争,企业的生存

欢迎来到我的优快云空间!这里聚焦AI大模型应用实战,分享前沿技术、实战案例与开发经验。 1095

how to create a j2ee with maven

1.note that add ejb to ear as a dependency

凤舞九天 139

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

使用Maven构建和部署J2EE应用程序的EAR文件

这篇文章,主要是技术上的整理,用来mark一下,用的时候参考。 一、新建项目 新建一个空的Maven Project项目 二、放入依赖 注:ear部署时如果里面有entity,会发生错误,所以不要把entity放到依赖项中,部署的时候先部实体,然后再部ear。 将需要打入EAR中的jar、war以dependenci

z69183787的专栏 1618

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

针对新手的Java EE7和Maven项目–第1部分–简单的Maven项目结构–父pom

为什么呢 很多时候,我在日常工作中试图解决一些基本或复杂的Maven / Java EE项目结构问题。 为了提供解决方案,我经常最终会尝试项目结构,测试我在不同应用程序服务器上的部署并细化我的配置。 Maven对于新来者来说可能会有陡峭的学习曲线,如果您将现代Java EE应用程序的“ 有时 ”复杂的配置要求添加进来,事情会变得更加令人沮丧。 在我的职业生涯中,我还看到很多初级Java开...

最佳 Java 编程 225

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

Java学习----Jenkins(善假于工具)

最近开始开发java项目,对于java这一套程序的发布流程进行了梳理,主要用到工具就是Jenkins,那么什么是Jenkins呢?问题就出来了。   提到Jenkins,就不得不提到其所属的范围或者说是本质,Jenkins是基于Java开发的一种持续集成工具,用于监控持续重复的工作,功能包括:   1、持续的软件版本发布/测试项目。   2、监控外部调用执行的工作。   我们知道在信息现代

李晓娜 2398

java ee7 入门_Java EE7和Maven工程入门(1)

Java EE7和Maven工程入门(1)Java EE7和Maven工程入门(1)目录一个简单Maven工程的结构为什么?在日常工作中,我经常需要解决许多简单的或者是复杂的Maven/Java EE工程结构的问题。为了找到解决办法,我经常要拿项目的结构做实验,在不同应用服务器上对部署进行测试并且调优。对新手来说,Maven可能有一个很漫长的学习曲线。如果你参与进一个经常需要非常复杂的配置的现代化...

weixin_31484881的博客 399

Apache Maven项目提供的EAR插件详解

EAR插件主要用于生成Java EE Enterprise Archive (EAR)文件,即将各种组件打包到一起生成一个ear文件。此外,EAR插件也可以用于生成EAR的部署描述符文件application.xml。 EAR插件的最新版本是2015.6发布的2.10.1 1. EAR插件提供的2个goal: ear:ear,生成Java EEEnterprise Arc

成长的足迹 3811

Maven - 打包进阶 jar war ear包差异与打包配置

本文详细介绍了Maven支持的三种Java打包格式:JAR、WAR和EAR。JAR是基础格式,适用于普通Java应用和库;WAR专为Web应用设计,需部署到Servlet容器;EAR用于企业级应用,包含多个模块。文章重点讲解了如何通过Maven的<packaging>标签控制打包类型,并提供了详细的配置示例:包括普通JAR、可执行JAR(使用maven-assembly-plugin和Spring Boot插件)以及WAR包的配置方法。还分析了每种格式的优缺点和适用场景,帮助开发者根据项目需求选

千淘万漉虽辛苦,吹尽狂沙始到金 2万+

EAR项目构建的几种方式

PS:说实话,在写这篇帖子之前,我也没用过EAR,因此该贴仅是记录学习过程用~有什么不对的地方,或者欠缺的,还请各位看官斧正,先谢过各位了~~ 一、基于传统WebProject方式 在eclipse中,右键new > project > Dynamic web project , 在弹出的对话框中输入项目名称testWeb,注意,在EAR membership中勾选上“Add project to an EAR”,并输入准备创建的EAR的名称,例如TestEAR, 再创建几个Web pr

xiaokanfuchen86的博客 1778
上一篇: Java 远程方法调用 RMI
下一篇: Java发送邮件javax.mail
conquer0715
博客等级 码龄18年 73粉丝 147原创
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值