How to avoid auto-apply in pre-compiled script plugin

I have created pre-compiled script plugin following this. Developing Custom Gradle Plugins

Is it possible to use apply false flag in pre-compiled script plugins like this.

plugins {
    id 'java-library'
    id 'io.spring.dependency-management'
    id 'org.springframework.boot' apply false
}

when i apply above plugin to main project, it applies spring-boot plugin too even though it is marked as apply false.

Thank you for your valuable time. any pointer would be helpful.