YunaiV / ruoyi-vue-pro

🔥 官方推荐 🔥 RuoYi-Vue 全新 Pro 版本,优化重构所有功能。基于 Spring Boot + MyBatis Plus + Vue & Element 实现的后台管理系统 + 微信小程序,支持 RBAC 动态权限、数据权限、SaaS 多租户、Flowable 工作流、三方登录、支付、短信、商城、CRM、ERP、AI 大模型等功能。你的 ⭐️ Star ⭐️,是作者生发的动力!
https://doc.iocoder.cn/
MIT License
26.58k stars 5.64k forks source link

flatten-maven-plugin插件flattenMode能否改为:oss或者ossrh #594

Open zoemak opened 1 month ago

zoemak commented 1 month ago

flatten-maven-plugin插件flattenMode能否改为:oss或者ossrh

当前:

<flattenMode>resolveCiFriendliesOnly</flattenMode>

编译效果.flattened-pom.xml的dependencies:

    <dependency>
      <groupId>cn.iocoder.boot</groupId>
      <artifactId>yudao-module-system-api</artifactId>
      <version>${revision}</version>
    </dependency>

这样导致一些组件上传到私服或者是本地,revision没有做插值处理;

假如自己的项目(com.demo:example:1.0-SNAPSHOT)也有用到flatten-maven-plugin,revision会识别成1.0-SNAPSHOT,导致yudao-module-system-api无法下载。

基本信息

你猜测可能的原因

从官方的说明来看,开源项目建议是用:oss或者ossrh的

编译效果:

    <dependency>
      <groupId>cn.iocoder.boot</groupId>
      <artifactId>yudao-module-system-api</artifactId>
      <version>2.1.0-jdk8-snapshot</version>
      <scope>compile</scope>
    </dependency>

FlattenMode说明

zoemak commented 1 month ago

还有一种解决办法 yudao根模块pom文件properties设置为:

<properties>
        <revision>2.1.0-jdk8-snapshot</revision>
        <yudao.version>${revision}</yudao.version>
</properties>

然后,把revision仅在子模块中的parent块使用:

    <parent>
        <groupId>cn.iocoder.boot</groupId>
        <artifactId>yudao-module-infra</artifactId>
        <version>${revision}</version>
    </parent>

但是在其他块中,均使用${yudao.version}:

        <dependency>
            <groupId>cn.iocoder.boot</groupId>
            <artifactId>yudao-module-system-api</artifactId>
            <version>${yudao.version}</version>
        </dependency>

这样就能够保证revision仅用于parent设置,在编译后会插值,同时保留子模块是能够识别到${yudao.version}的,比如编译后的

根模块:

  <properties>
    <revision>2.1.0-jdk8-snapshot</revision>
    <yudao.version>2.1.0-jdk8-snapshot</yudao.version>
  </properties>

子模块:

  <parent>
    <groupId>cn.iocoder.boot</groupId>
    <artifactId>yudao-module-infra</artifactId>
    <version>2.1.0-jdk8-snapshot</version>
  </parent>
  <artifactId>yudao-module-infra-biz</artifactId>
  <version>2.1.0-jdk8-snapshot</version>
  <dependencies>
    <dependency>
      <groupId>cn.iocoder.boot</groupId>
      <artifactId>yudao-module-system-api</artifactId>
      <version>${yudao.version}</version>
    </dependency>

也不影响其他项目使用revision

YunaiV commented 1 month ago

收到,我预计 8 月份会研究下哈