我在文本文件中列出了大量的 jar 及其版本。 例如:
。 。 。 .
此列表包含 500 多个罐子。
问题:我需要一个包含所有这些 jars 作为依赖项的 pom.xml。 我需要这个来在 github 中进行 GHAS 扫描以确定 EOL
任何由 maven 构建的 jar 文件都应该在
pom.properties
下有 META-INF\maven\${groupId}\${artifactId}
文件。此 pom.properties
文件应包含 groupId
、artifactId
和 version
。
我个人会编写一个 gradle/groovy 脚本来迭代 jar 文件列表,提取
pom.properties
文件并编写 pom.xml
片段(因为 gradle 有非常好的 api 用于迭代文件和从 zipfile 中读取)。
但是编写一个 java main 来做类似的事情就足够简单了(使用
ZipInputStream
)