【问题标题】:Gradle, Is there a way to alias namspace of dependencyGradle,有没有办法给依赖的命名空间起别名
【发布时间】:2022-07-23 13:27:59
【问题描述】:

我想使用我从开源中派生的自定义库。我使用 jitpack 从我的 github 存储库中提取依赖项。问题是,命名空间已更改为

"com.github.user.Repo:module-name:version"

我将不得不将此命名空间替换为整个项目,这是一项非常艰巨的工作。那么有没有办法将命名空间从“com.github.user.Repo:module-name:version”别名为“org.opensource:module-name:version”

【问题讨论】:

    标签: gradle build.gradle


    【解决方案1】:

    配置MavenPublication时不需要任何别名;对于 GitHub example

    group = 'io.syslogic'
    version = '1.0.0'
    
    afterEvaluate {
        publishing {
            publications {
                release(MavenPublication) {
                    groupId = group
                    artifactId = 'androidx-colorpicker'
                    from components.getByName('release')
                    version = version_name
                }
            }
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-03
      • 1970-01-01
      • 1970-01-01
      • 2021-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多