I’m not sure I understand. Do you want to exclude the transitive dependency of ‘Test-security’? If so, how would that be any different since you are explicitly adding a dependency to ‘Test-persistence’?
Thanks for your reply. There was a mistake in the example. I edited that. For compilation, Test-security and Test-service both use Test-persistence. Also, Test-service uses Test-security. When I am trying to use Test-security in Test-service, I want to exclude Test-persistence which is present in Test-security.
What are you trying to accomplish? Why do you want to exclude that particular project dependency? Excluding ‘Test-persistence’ from ‘Test-security’ will have the same final result since you are explicitly depending on it.
Sorry for the delayed response. I want to exclude Test-persistence from Test-security because when Test-service is getting loaded, the Application is trying to register entity manager for Hibernate twice as it is present in both Test-security and Test-service. Also, I wanted to learn how to exclude a project dependency.