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

Issue 12183 - Remove unnecessary test dependencies from build #12390

Merged
merged 1 commit into from Mar 9, 2022

Conversation

yuri1969
Copy link
Contributor

A quick attempt to resolve #12183. It was based on a Gradle dependency listing obtained from a 5.1.2 REST application.

Aimed to remove just the test-related dependencies.

  • Removed unused groovy-ant from grails-plugin-i18n.
  • Removed unused junit from grails-plugin-url-mappings.
  • Upgraded cache plugin to solve gpars-related issues.
  • Moved spring-test to the test source set.

Notes:

  • Dependency constraint (marked as (c)) should be fine.
  • BOM dependencies should also be fine.
  • GrailsWebMockUtil was moved to the grails-test project - is it a correct location?

Based on a Gradle dependency listing obtained from
a 5.1.2 REST application.

Aimed to remove just the test-related dependencies.

* Removed unused `groovy-ant` from `grails-plugin-i18n`.
* Removed unused `junit` from `grails-plugin-url-mappings`.
* Upgraded `cache` plugin to solve `gpars`-related issues.
* Moved `spring-test` to the test source set.

Notes:
* Dependency constraint (marked as `(c)`) should be fine.
* BOM dependencies should also be fine.
* `GrailsWebMockUtil` was moved to the `grails-test` project - is it
  correct?
@CLAassistant
Copy link

CLAassistant commented Feb 20, 2022

CLA assistant check
All committers have signed the CLA.

@puneetbehl puneetbehl merged commit ca01dbe into grails:5.1.x Mar 9, 2022
@manishkbharti
Copy link

manishkbharti commented Mar 17, 2022

@yuri1969 , @puneetbehl ,

GrailsWebMockUtil is not accessible now because it moved from util to test.
I am using this file to change the locale for localization in a cron job.

Is there an alternative to this? Please suggest.

puneetbehl pushed a commit that referenced this pull request Mar 29, 2022
@puneetbehl
Copy link
Contributor

@yuri1969 I have reverted this change and will do a Grails 5.1.5 release as this seems to break applications updating from 5.1.x. I think we should move this change to 5.2.x and have clean upgrade notes.

@manishkbharti You should add the following dependency to build in order to resolve this:

testImplementation("org.grails:grails-test:${grailsVersion}")

@manishkbharti
Copy link

Thank you @puneetbehl
Sure I'll use this dependency.

@yuri1969
Copy link
Contributor Author

@puneetbehl You are right. The PR should go to the 5.2.x branch. Having a doc note at least describing impact of the scope change for org.springframework.spring-test would be nice. Would you do it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Produced web application archive (gradle assemble) contains a lot of unnecessary dependencies
4 participants