Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hutool-bom 问题 #1261

Closed
dong4j opened this issue Nov 27, 2020 · 2 comments
Closed

hutool-bom 问题 #1261

dong4j opened this issue Nov 27, 2020 · 2 comments
Labels

Comments

@dong4j
Copy link

dong4j commented Nov 27, 2020

一般的 bom 都是为了管理项目下所有模块的版本, 像 spring-framework-bom 一样, 我不想使用 hutool-all, 而是按照我的需求去添加具体的子模块, 我想使用 hutool-bom 去管理版本, 但是这样使用则不行:

<dependency>
    <groupId>cn.hutool</groupId>
    <artifactId>hutool-bom</artifactId>
    <version>${hutool.version}</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>

能否将 hutool-bom 修改一下, 用以下这种方式:

<dependencyManagement>
    <dependency>
        <groupId>cn.hutool</groupId>
        <artifactId>hutool-core</artifactId>
        <version>${project.version}</version>
    </dependency>
    ...
</dependencyManagement>

这样我就不会在父模块中维护全部的子模块, 只需要使用 hutool-bom, 如果修改 hutool-bom 会影响其他用户, 也可添加 hutool-dependencies 来统一管理

@looly
Copy link
Member

looly commented Nov 28, 2020

hutool的bom与其他框架略有不同,使用的是排除法:即默认是引入所有模块,通过排除去除不需要的模块。

@looly
Copy link
Member

looly commented Nov 28, 2020

这个修改影响比较大。所以不考虑修改。

最简单的是引入hutool-all,体积并没有太大。

@looly looly closed this as completed Nov 28, 2020
@looly looly added the question label Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants