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

按文档中的 Maven-Publish 配置生成的 pom 文件中缺少 dependencies 节点 #3

Open
Heart-Beats opened this issue Nov 20, 2024 · 6 comments

Comments

@Heart-Beats
Copy link

相关配置如下:

medivhPublisher {
  groupId module_group
  artifactId module_name
  version versions.publish_version

  // Mostly self-explanatory metadata
  pom {
    packaging 'aar'
    name = module_name
    description = '😍 A beautiful, fluid, and extensible dialogs API for Kotlin & Android.'
    url = 'https://github.com/Heart-Beats/material-dialogs'
    licenses {
      license {
        name = 'Apache 2.0 License'
        url = 'https://github.com/Heart-Beats/material-dialogs/blob/main/LICENSE.md'
      }
    }
    developers {
      developer {
        id = 'afollestad'
        name = 'Aidan Follestad'
        email = '[email protected]'
      }
      // Add all other devs here...
    }
    // Version control info - if you're using GitHub, follow the format as seen here
    scm {
      connection = 'scm:git:github.com/Heart-Beats/material-dialogs.git'
      developerConnection = 'scm:git:ssh://github.com/Heart-Beats/material-dialogs.git'
      url = 'https://github.com/Heart-Beats/material-dialogs/tree/main'
    }
  }
}

实际发现生成的 pom 文件中缺少相关依赖:
image

这是组件的实际依赖情况:
image

希望 pom 执行默认值填充时添加上 withXml{ } 代码块,支持 POM 文件生成 dependencies 节点并添加相关依赖

@gongxuanzhang
Copy link
Contributor

收到

@gongxuanzhang
Copy link
Contributor

@Heart-Beats 我这边增加配置之后看到的Pom是有dependencies相关内容的。
可否提供一个可以复现问题的仓库。

@gongxuanzhang
Copy link
Contributor

至于withXml代码块也是支持的,可以更新版本到1.2.1
你可以这样设置

medivhPublisher {
    pom{
        withXml {
            asNode().appendNode("properties").appendNode("my-property", "my-value")
        }
    }
}

最终的xml会出现类似于这样的标签

 <properties>
    <my-property>my-value</my-property>
  </properties>

@gongxuanzhang
Copy link
Contributor

哦我找到问题了 是安卓的适配问题,我会去处理 @Heart-Beats

@Heart-Beats
Copy link
Author

至于withXml代码块也是支持的,可以更新版本到1.2.1 你可以这样设置

medivhPublisher {
    pom{
        withXml {
            asNode().appendNode("properties").appendNode("my-property", "my-value")
        }
    }
}

最终的xml会出现类似于这样的标签

 <properties>
    <my-property>my-value</my-property>
  </properties>

不好意思,之前没看到,我看这里生成的 POM 文件标签是不是好像不对呀,正常是需要 dependency 标签的,properties 标签反而没那么重要,因此默认生成的应该是需要 dependency 标签的, https://github.com/Heart-Beats/material-dialogs/blob/main/gradle/android_publish_mavencentral_portal.gradle#L98 这个是我当时适配时的创建标签代码,可以参考一下, 复现问题的仓库也可以使用这个

@gongxuanzhang
Copy link
Contributor

这些都是安卓插件的适配问题,我不太熟悉安卓 最近有点忙 我学习一下把这个部分完善

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants