MAVEN原型选择 [英] MAVEN Archetype choosing

查看:126
本文介绍了MAVEN原型选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚成为Maven的新手. 我的要求是用2次大战制造一只耳朵,并制造一个罐子. 我尝试使用一些原型,但是缺少一些文件夹结构. 我的Maven文件夹结构应包含 src/main/ 爪哇 资源 网路应用程式 测试/java 测试/资源. 哪种原型是合适的?

Hi i am just new to maven. My requirement is to build a ear with 2 wars and also create a jar. I tried using some archetypes but few folder structure are missing. My maven folder structure should contain src/main/ java resource webapp test/java test/resource. Which archetype will be a suitable?

推荐答案

您不能在单个项目中使用它,因为EAR由不同的模块组成.

You cannot have it in single project, Since the EAR consists of different modules.

因此,请为war,jar和build创建一个单独的项目.

So create separate project for war, jar and build.

要创建war文件,请使用maven-archetype-webapp,对于jar,请使用maven-archetype-quickstart.

To create war file use maven-archetype-webapp, and for jar use maven-archetype-quickstart.

然后将这些项目模块与模块

Then include those project module in main project pom file with module

例如

<modules>
    <module>expLogdao</module>
    <module>expLogservice</module>
    <module>expLogweb</module>
    <module>expLogear</module>
</modules>

然后使用单独的项目来构建耳朵

Then use separate project to build ear

现在将所有项目模块都包含在ear项目依赖项标签中

Now include all project modules in ear project dependencies tag

    <dependency>
        <groupId>com.expLog.service</groupId>
        <artifactId>expLogservice</artifactId>
        <type>jar</type>
        <version>0.0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.expLog.dao</groupId>
        <artifactId>expLogdao</artifactId>
        <type>jar</type>
        <version>0.0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.expLog.web</groupId>
        <artifactId>expLogweb</artifactId>
        <type>war</type>
        <version>0.0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>

这篇关于MAVEN原型选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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