English 中文(简体)
多功能
原标题:Multi-Modules maven pom

虽然我首次撰写了多功能杂草,但我很想知道。

首先,在座各位:

    ...
    <modelVersion>4.0.0</modelVersion>
    <groupId>project.room_management</groupId>
    <artifactId>room_management</artifactId>
    <packaging>pom</packaging>
    <version>1.0</version>
    <name>room_management</name>
    <modules>
        <module>room_management_dao</module>
        <module>room_management_domain</module>
        <module>room_management_service</module>
        <module>room_management_gui</module>
    </modules>
    ...

a. 子女之一:

     ...
    <parent>
        <groupId>project.room_management</groupId>
        <artifactId>room_management</artifactId>
        <version>1.0</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <groupId>project.room_management</groupId>
    <artifactId>room_management_domain</artifactId>
    <version>1.0</version>
   ...

考虑到我不需要共同单元从父母到孩子们,我能否将父母声明的“风险”移到孩子们的 p中? 或者是否需要汇编模块?

最佳回答

You do not need the <parent> section in the modules.

这主要意味着每个单元必须独立,你不能通过上级分享组合。

问题回答

In this example you need the parent element, cause you have dependencies between gui and your service (service to dao as well). Furthermore you need to define the dependencies between the modules to see which module uses which. On the other hand maven needs this information to predict the order of build of the modules which is important. The next advantage of having such relationship is you can define the plugins/versions of dependencies in the parent module and many other things.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签