最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

maven - When depending on a parent, include all sub-modules automatically - Stack Overflow

programmeradmin2浏览0评论

I've this project:

The sub-modules in driven-adapters can grow or decrease. What I'd like to do is when including the dependency on the parent (driven-adapters) it will bring on the dependencies/sub-modules in it.

In other words the configurator is simple, like this:

<dependencies>
    ...
    <dependency>
        <groupId>.simonegiusso</groupId>
        <artifactId>driving-adapters</artifactId>
        <version>${revision}</version>
        <scope>runtime</scope>
    </dependency>
    ...
</dependencies>

instead of:

<dependencies>
    ...
    <dependency>
        <groupId>.simonegiusso</groupId>
        <artifactId>timeseries-source-postgres</artifactId>
        <version>${revision}</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>.simonegiusso</groupId>
        <artifactId>timeseries-source-cassandra</artifactId>
        <version>${revision}</version>
        <scope>runtime</scope>
    </dependency>
    ...
</dependencies>

In this way when I add or remove a sub-module from driven-adapter I don't have to do any changes in the configurator/pom.xml

Is it possible to achieve this?

I've this project:

The sub-modules in driven-adapters can grow or decrease. What I'd like to do is when including the dependency on the parent (driven-adapters) it will bring on the dependencies/sub-modules in it.

In other words the configurator is simple, like this:

<dependencies>
    ...
    <dependency>
        <groupId>.simonegiusso</groupId>
        <artifactId>driving-adapters</artifactId>
        <version>${revision}</version>
        <scope>runtime</scope>
    </dependency>
    ...
</dependencies>

instead of:

<dependencies>
    ...
    <dependency>
        <groupId>.simonegiusso</groupId>
        <artifactId>timeseries-source-postgres</artifactId>
        <version>${revision}</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>.simonegiusso</groupId>
        <artifactId>timeseries-source-cassandra</artifactId>
        <version>${revision}</version>
        <scope>runtime</scope>
    </dependency>
    ...
</dependencies>

In this way when I add or remove a sub-module from driven-adapter I don't have to do any changes in the configurator/pom.xml

Is it possible to achieve this?

Share Improve this question asked Feb 15 at 10:03 SGiuxSGiux 8393 gold badges15 silver badges39 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

No.

The modules of a parent will not be your dependencies, and you cannot change that.

发布评论

评论列表(0)

  1. 暂无评论