Maven: Combining multiple module jars into one war file?

前端 未结 1 374
庸人自扰
庸人自扰 2020-12-05 03:37

I have a project babybird which has 3 components persistence, business and service

in babybird\'s

相关标签:
1条回答
  • 2020-12-05 04:06

    That's fairly simple. Create another module named web or similar:

    <modules>
        <module>persistence</module>
        <module>business</module>
        <module>service</module>
        <module>web</module>
    </modules>
    

    web module should depend on all others:

    <dependencies>
        <dependency>
            <groupId>...</groupId>
            <artifactId>persistence</artifactId>
        </dependency>
        ...
    </dependencies>
    

    and have war packaging:

    <packaging>war</packaging>
    

    You'll also need web.xml in /src/main/webapp/WEB-INF. That's it.

    0 讨论(0)
提交回复
热议问题