Skip to content

Declare used dependencies - #81

Merged
elharo merged 7 commits into
masterfrom
deps
Dec 2, 2024
Merged

elharo merged 7 commits into
masterfrom
deps

Conversation

@elharo

@elharo elharo commented Dec 2, 2024

Copy link
Copy Markdown
Contributor

No description provided.

@elharo
elharo requested review from gnodet and slachiewicz December 2, 2024 13:45
@gnodet

gnodet commented Dec 2, 2024

Copy link
Copy Markdown
Contributor

Should we enable maven-dependency-analyzer with failOnUnusedDeclaredDependencies and failOnWarning
in some parent ?

@elharo

elharo commented Dec 2, 2024

Copy link
Copy Markdown
Contributor Author

Probably not yet. That would break a lot of other plugins that haven't been cleaned up yet.

@gnodet

gnodet commented Dec 2, 2024

Copy link
Copy Markdown
Contributor

Probably not yet. That would break a lot of other plugins that haven't been cleaned up yet.

That would break plugins only when upgrading the parent. The exact point is to enforce new plugin releases to have clean dependencies. Anyway, not a big deal...

@elharo

elharo commented Dec 2, 2024

Copy link
Copy Markdown
Contributor Author

Yes, that's true. It's still a lot of extra work to do before updating the parent, which might need to be done quickly for unrelated reasons.

@gnodet

gnodet commented Dec 2, 2024

Copy link
Copy Markdown
Contributor

Yes, that's true. It's still a lot of extra work to do before updating the parent, which might need to be done quickly for unrelated reasons.

Given the m-dependency-p's analyze goal knows about direct dependencies, why don't we have a goal to automatically fix these dependencies, i.e. remove unused ones and add undeclared ones. Even if that's not perfect, it could still be tuned by the user, but it would remove a big part of the tedious work.

@elharo

elharo commented Dec 2, 2024

Copy link
Copy Markdown
Contributor Author

I've probably got the analyzer to the point where adding used undeclared dependencies makes sense. Removing "unused" dependencies is trickier since so many of those are loaded by reflection, service providers, or other mechanisms that the analyzer doesn't see. But sure, go ahead and file a feature request on maven-dependency-plugin Jira.

Meanwhile can we merge this PR?

@elharo
elharo merged commit ffca18f into master Dec 2, 2024
@elharo
elharo deleted the deps branch December 2, 2024 15:38
@slawekjaranowski slawekjaranowski added this to the 4.0.0-beta-4 milestone Aug 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants