简体   繁体   English

如何让 Maven 只下载所有(传递)依赖项的 POM 文件?

[英]How to make Maven download only the POM files for all (transitive) dependencies?

I'm currently using the maven-dependency-plugin like我目前正在使用maven-dependency-plugin 之类的

mvn -B dependency:copy-dependencies \
    -Dmdep.copyPom=true \
    -DoutputDirectory="$OUTDIR"

to download all POMs of all (transitive) dependencies.下载所有(传递)依赖项的所有 POM。 However, that is also downloading the JARs, which I don't want.但是,这也会下载我不想要的 JAR。 I tried to use includeTypes / excludeTypes to limit to POM files only, but that didn't work as nothing is retrieved then.我尝试使用includeTypes / excludeTypes来限制 POM 文件,但这不起作用,因为当时没有检索到任何内容。

Is there another option / command that really just retrieves the POMs?是否有另一个选项/命令真的只是检索 POM?

Background: I only need the meta-data from all transitive POMs for compliance checks.背景:我只需要来自所有可传递 POM 的元数据来进行合规性检查。

I ended up creating an Open Source project that downloads and gathers meta-data from Maven builds, and actually several other build systems , too.我最终创建了一个开源项目,该项目从 Maven 构建以及其他几个构建系统下载和收集元数据。 It's called OSS Review Toolkit (ORT for short) and programmatically uses the maven-resolver library to download only the POMs to analyze their contained meta-data.它被称为OSS Review Toolkit (简称 ORT),并以编程方式使用maven-resolver库仅下载 POM 以分析其包含的元数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Maven pom将jar文件仅下载到特定目录? - How to use Maven pom to download jar files only to a specific directory? 从Maven存储库下载所有pom文件 - Download all pom files from maven repository 如何仅从pom.xml而不是从Maven本身将Maven依赖项下载到本地存储库中 - How to download Maven dependencies into a local repository, only from pom.xml, not from Maven itself 为什么在Maven树中未将POM类型的依存关系显示为传递依存关系? - Why are POM-typed dependencies not shown as transitive dependencies in the Maven tree? 传输Maven依赖项+所有传递+父POM - Transfer a Maven dependency + all transitive + parent POM IntelliJ:如何使Maven项目仅使用pom.xml文件中显示的依赖项 - IntelliJ: How to make Maven project use only the dependencies show in pom.xml file Maven 蚂蚁任务。 传递 (pom) 依赖项和 https 问题 - Maven ant task. Transitive (pom) dependencies and https issue 如何检查Maven POM中使用的所有依赖项? - How can I checkout all dependencies used in a Maven POM? 如何使用 maven 下载具有所有依赖项的 jars? - How to use a maven to download jars with all dependencies? 如何使用Maven Artifact Resolver解决Maven依赖关系并获取所有传递依赖关系? - How to resolve maven dependency and get all the transitive dependencies using Maven Artifact Resolver?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM