autonomousapps / autonomousapps/dependency-analysis-gradle-plugin

fixDependencies task loses exclusions when changing configuration

Open
#1,652 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
2.2k
Forks
158
Avg merge
16h 25m
Merged PRs (30d)
46

Description

**Plugin version**
3.6.1

**Gradle version**
9.0.0

**JDK version**
21

**Describe the bug**
An existing dependency is configured as
```
api(project(":myProject")) {
exclude(group = "another project", module = "another module")
}
```

The `fixDependencies` task decides that this should be an `implementation` configuration instead. However when it runs it drops the exclude block so we get
```
implementation(project(":myProject"))
```

**To Reproduce**
1. Add a dependency with `api` configuration (which should be an `implementation` configuration) and an `exclude` block
2. Run `gradle fixDependencies`

**Expected behavior**
The `exclude` block should be maintained, so we should get an output
```
implementation(project(":myProject")) {
exclude(group = "another project", module = "another module")
}
```

Contributor guide

Open the contributing guide

Research direction

Start at the fixDependencies task and trace how it rewrites an api dependency to implementation, focusing on how the existing exclude block is represented and preserved. Reproduce the issue with the Gradle command from the report; done means the generated implementation dependency retains the exclude block shown in the expected output.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.