Change gradle copy to sync to clear old jars #609
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
There is a step in our gradle build that copies jar files from the project (e.g. Replayer) build artifacts directory into a
dockerSolution
build directory, which is where the generated Dockerfile expects them to be to copy them into the image.However, this
dockerSolution
build directory is only "emptied" on agradle clean
, which means that as versions of our dependencies are updated, that build directory is effectively append-only and continues collecting old versions of jars, which are then copied into our images.This causes issues. In this specific case, conflicting versions of log4j2 were causing the replayer to crash on startup, when the image was being built in a non-clean environment.
We're also probably making our images larger than they need to be.
The same pattern was being used in TrafficCapture and RFS gradle build scripts, so both have been updated.
Issues Resolved
n/a
Testing
Local testing.
Along with functional testing, I did:
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.