Closed steromano87 closed 3 years ago
I have turned off default removing of go.sum (it can be still turned on through either <deleteSumFile>true</deleteSumFile>
or <mvn.golang.delete.sum.file>true</mvn.golang.delete.sum.file>
try please 2.3.8-SNAPSHOT
also in snapshot version added mod
property for module aware commands so that it can be changed to <mod>mod</mod>
to override default GoSDK 16 behavior readonly
Checked with version 2.3.8-SNAPSHOT (updated at commit 9467f6b7b0e8d304b366ea0e78fcd66e35e3b26a) and it works flawlessly using Go SDK 1.16. Now the go.sum
file is correctly preserved.
Description
While using Go 1.15 with module support, any error in the
go.sum
file was automatically fixed during the build phase. However, with Go 1.16, this automatic fix was disabled (see here).Unfortunately, during build time the
go.sum
file is deleted and never restored. As a result, building any project using the new Go version yields the following error during any stage of the build:You can find the complete output of
mvn clean compile
command using a simple Maven project attached to this bug.Here there is the parent POM of my project (defining the configuration of the mvn-golang-wrapper plugin):
This is the child POM that contains basic configuration for the specific module:
mvn-go-wrapper-error.txt
Expected result
The
go.sum
file is never deleted during any phase if the Go SDK version is equal or greater 1.16, because the file is not automatically restored.Actual result
The
go.sum
file is always deleted during build time, yielding the mentioned error for Go SDK >= 1.16.Temporary workaround
If the automatic download of the SDK is enabled and the version of the SDK is set to a version prior to 1.16 (namely: 1.15.8), the same configuration works because the missing
go.sum
file is autimatically handled during build time.