Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Classes declared in spring xml configuration are not kept as dependencies #78

Open
afillatre opened this issue Apr 11, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@afillatre
Copy link
Contributor

afillatre commented Apr 11, 2021

Describe the bug
Classes configured in spring's bean.xml files are not kept as mandatory dependencies.

To Reproduce
Steps to reproduce the behavior:

  1. Create a Spring project with XML configuration
  2. Add rightful maven dependencies
  3. Run depclean

Expected behavior
All spring beans declared in the XML configuration count as rightful dependencies

Additional context
It may be the same with Java Config textual declaration inside annotations (but I don't have a use case in mind ATM)

It fails too for XML namespace imports:

[ERROR] myTest  Time elapsed: 0 s  <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: 
Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/data/jpa]
Offending resource: class path resource [my-beans.xml]
@afillatre afillatre added the bug Something isn't working label Apr 11, 2021
@cesarsotovalero
Copy link
Collaborator

Hi @afillatre,
The only solution that comes to my mind for this issue is writing an XML parser in DepClean that inspect the XML files in src/main/resources to search for dependencies injected via XML annotations from the code.
WDYT?

@cesarsotovalero cesarsotovalero self-assigned this Apr 7, 2022
@afillatre
Copy link
Contributor Author

Yes, that's what I had in mind. This issue relates with #81 BTW

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants