-
Notifications
You must be signed in to change notification settings - Fork 951
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
5.0.0.RC2: HSQLDB or H2 should not be part of built artifact, when not defined in build.gradle #11753
Comments
Haven't checked this specifically with provided group: 'com.h2database', name: 'h2', version: '1.4.200' In this case gradle should not pack specified library in resulting jar/war file. |
@yuri1969 I did test with the new Grails version 5.1.4 today and the hsqldb dependency is now gone from the build artifact. But it seems that H2 is still included:
H2 seems to be coming from micronaut-bom, which I don't understand. Shouldn't the BOM just define versions and not actually include anything? |
@davidkron You are right, the H2 somehow slipped and is still a part of the 5.1.4 build artifact regardless of the
I'll try to look into that. |
@davidkron Update: The default Grails web profile pulls a newish The |
Can you do this?
|
@davidkron That is true, but that is only 1 of the places. By default, there are multiple dependencies in newly created 5.1.4 app which have transitive dependencies on h2. |
That |
@yuri1969 You are right about the |
Has there been any way to exclude h2 from the built war file? The 1.4.200 version of H2 now has security vulnerabilities hence having it the production war file is problematic. |
@davidkron Recently, Grails 5.2.5 has updated the base profile to 5.1.1. That one includes updated asset-pipeline to 3.4.7 which includes the PR fixing This means any app using the default profile based on the newest release of Grails 5.2.5 should be free of any implicit H2 dependency. The only remaining one should be the explicit one located in After removing that one, @jchharris Did you try the latest Grails 5.2.5? Can you confirm H2 is still included in a production WAR file? |
@yuri1969 I haven't yet. I am on Grails 5.2.4 and I had upgraded asset-pipeline to 4.0.0 but H2 was still appearing in the WAR. I will try upgrading Grails and report back. |
@yuri1969 That solved it coming in through Grails itself, however some Grails plugins drag it in as well:
I'll see if I can get Gradle to exclude them |
@jchharris You are right, I haven't checked the plugins... I'll see if I can go through at least some of them. |
Thanks @yuri1969. I think "io.github.gpc:jms" may also have a similar problem. grails-dependencies is set as a runtime dependency. |
The liquibase-hibernate-related H2 leak can be tracked under liquibase/liquibase-hibernate#444. |
@yuri1969 I've created PRs to fix the dependency leakage issue in the Grails Database Migration plugin as well as the Spring Security Core plugin. |
@jchharris I don't fully understand the reasoning behind grails-dependencies, but it seems |
@yuri1969 I'm not sure, but if you create a new Grails plugin or app off of 5.2.5, grails-dependencies is not in the Gradle build file. Seems like something has changed along the line and it should no longer be a dependency. Would need some clarification on this from @puneetbehl |
And another one: sbglasius/external-config#64 |
I created a fresh Grails 4.0.8 application and tried to exclude h2 from the resulting build artifact. Is tried to simply remove the h2 dependency from
build.gradle
. But h2 is still somehow referenced and can be found in the .war file. Also I found that HSQLDB is included as well.I remember from Grails 3.x applications that it should be to possible to exclude h2 by this, but this doesn't seem to work anymore:
From
./gradlew dependencies
it seems h2/hsqldb gets included fromgrails-plugin-datasource
, so I tried it this way:This doesn't work either. But even if it would work, I don't think this is a reasonable default behavior, as no one really uses h2/hsqldb in production.
Task List
Steps to Reproduce
Expected Behaviour
HSQLDB and h2 should not be included in the resulting artifact.
Actual Behaviour
Both HSQLDB and h2 are found.
Environment Information
The text was updated successfully, but these errors were encountered: