Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Improve plugin id search in subprojects block

未关闭
#271 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
java
领域
build-system, cli

调研方向

从 src/main/java/com/canonical/devpackspring/rewrite/visitors/FindMethodVisitor.java:47-50 开始,重点关注 containsLiteral 及其与 find(subtree, METHOD_APPLY, true) 的使用。跟踪 AddPluginVisitorSupport.handleSubprojectsBlock,以确认此匹配如何控制插入。当无关的嵌套参数不被计为现有的插件应用,而预期的插件参数仍被计为插件应用时,即完成。

由索引模型根据 Issue 内容生成。

描述

─── src/main/java/com/canonical/devpackspring/rewrite/visitors/FindMethodVisitor.java:47-50 ───
[bug · medium] In `containsLiteral`, the plugin-id literal is matched *anywhere* inside the `apply`
invocation subtree (including nested expressions/arguments such as a `from`/`to` map entry), not
specifically the plugin argument. Combined with `find(subtree, METHOD_APPLY, true)` (recursive), an
`apply` call in a `subprojects` block that happens to contain the plugin id string in an unrelated
nested argument would be treated as "plugin already applied" and
`AddPluginVisitorSupport.handleSubprojectsBlock` would skip adding the `apply plugin` statement.
Consider matching only the expected argument position (e.g., the `plugin:`/`plugin =` argument)
instead of any literal in the subtree.
主要语言
Java
星标
1
派生
5
平均合并
2 天 30 分钟
30 天内合并 PR
17

环境准备

我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

canonical/devpack-for-spring-cli 的其他 Issue

查看 canonical/devpack-for-spring-cli 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。