CycloneDX / CycloneDX/cyclonedx-maven-plugin

includeProvidedScope=false not working, Could not transfer artifact, status: 401

Open
#191 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
385
Forks
107
Avg merge
17h 31m
Merged PRs (30d)
7

Description

I want to build SBOMs on my project.

```
mvn install
```
can collect all dependencies and gives me success:
```
[INFO] BUILD SUCCESS
```

However running your plugin like this:
```
mvn org.cyclonedx:cyclonedx-maven-plugin:2.7.0:makeBom -DincludeProvidedScope=false
```

Gives me the following error:
```
[ERROR] Failed to execute goal org.cyclonedx:cyclonedx-maven-plugin:2.7.0:makeBom (default-cli) on project devon4j-json: An error occurred building dependency graph: Could not collect dependencies: com.devonfw.java.modules:devon4j-json:jar:2020.12.002-SNAPSHOT: Failed to collect dependencies at org.springframework.data:spring-data-commons:jar:2.3.3.RELEASE -> com.querydsl:querydsl-apt:jar:4.3.1 -> org.springframework.roo:org.springframework.roo.annotations:jar:1.2.3.RELEASE: Failed to read artifact descriptor for org.springframework.roo:org.springframework.roo.annotations:jar:1.2.3.RELEASE: Could not transfer artifact org.springframework.roo:org.springframework.roo.annotations:pom:1.2.3.RELEASE from/to spring-libs-release (https://repo.spring.io/libs-release): authentication failed for https://repo.spring.io/libs-release/org/springframework/roo/org.springframework.roo.annotations/1.2.3.RELEASE/org.springframework.roo.annotations-1.2.3.RELEASE.pom, status: 401 Unauthorized -> [Help 1]
```

However, when I look at the according POM [querydsl-apt-4.3.1](https://repo1.maven.org/maven2/com/querydsl/querydsl-apt/4.3.1/querydsl-apt-4.3.1.pom), I can see this:
```
dependency>
org.springframework.roo
org.springframework.roo.annotations
1.2.3.RELEASE
provided
```

As I specified `includeProvidedScope=false` I assume there is some bug in your plugin.
Further I am confused why the download is happening from `https://repo.spring.io/libs-release/org/springframework/roo/org.springframework.roo.annotations/1.2.3.RELEASE/org.springframework.roo.annotations-1.2.3.RELEASE.pom`. My project is not configuring additional maven repositories so only maven central should be used. And maven central does not require authentication so I should never end up with `401`.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the documented mvn install and cyclonedx-maven-plugin:2.7.0:makeBom commands, then inspect dependency collection and handling of the includeProvidedScope parameter. Compare the querydsl-apt POM's provided dependency with the repository resolution that reaches repo.spring.io; done means the command completes without resolving that excluded dependency or producing the 401 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.