gpc / grails-mail

The Grails Mail Plugin
http://grails.org/plugin/mail
Apache License 2.0
45 stars 85 forks source link

fix(deps): set compileOnly dependencies #56

Closed matrei closed 4 days ago

matrei commented 5 days ago

The jakarta-servlet-api was previously included as a transitive dependency, but it is no longer available through that path. To resolve the issue, this commit explicitly adds jakarta-servlet-api as a compileOnly dependency to ensure the necessary classes are available during compilation without bundling them into the final artifact.

Also change scopes of groovy and grails-core dependencies to compileOnly as these will always be provided to a grails plugin.

codeconsole commented 5 days ago

@matrei yeah, unfortunately now the plugins have the burden of resolving the servlet-api. I don't think there is a way to make it transitive, but compile only?

Due to AST transformations. Any plugin that has a TagLib or Controller will need the servlet-api added in order to be able to compile it.

codeconsole commented 5 days ago

Quick question before you merge, should we be resolving the servlet-api and other versions from the bom instead?

matrei commented 5 days ago

I don't think there is a way to make it transitive, but compile only?

Isn't that what the compileOnlyApi scope is for?

codeconsole commented 4 days ago

I don't think there is a way to make it transitive, but compile only?

Isn't that what the compileOnlyApi scope is for?

that's why I was asking. yeah, that looks like the best path..

The goal is to minimize dependency resolution and dependency imports. We have way too many dependency imports in our starter app that should not be needed.

We really need to create a list of plugins that use AST transforms and identify what imports they need specific to those transforms. Those would probably be the only location for compileOnlyApi.

codeconsole commented 4 days ago

Either way the servlet-api is going to be needed for

https://github.com/gpc/grails-mail/blob/5.0.x/src/main/groovy/grails/plugins/mail/MailMessageContentRenderer.groovy

And there are no ast transforms or traits in this class that will propagate the resolution of the servlet-api