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

go.mod Backup file is restored in wrong directory #73

Closed
Theoderich opened this issue Sep 9, 2020 · 1 comment
Closed

go.mod Backup file is restored in wrong directory #73

Theoderich opened this issue Sep 9, 2020 · 1 comment
Labels

Comments

@Theoderich
Copy link
Contributor

When the plugin modifies a go.mod file in a build step with moduleMode on, the original go.mod file is copied to ".#go.mod.mvn.orig".
After the build step, the modified go.mod file is replaced with the backed up version.
Unfortunately, the backup restore process is buggy. The backup is always copied to ${project.build.sourceDirectory}/go.mod, regardless to where the original go.mod file that was originally backed up resided.

For Example:
Before build step:
src/main/go/my-package/go.mod
After build step:
src/main/go/my-package/go.mod <-- file as modified by the plugin
src/main/go/go.mod <-- original go.mod file

This breaks the build, since follow-up build steps now see two go.mod and thus assume that src/main/go is the correct working directory instead of src/main/go/my-package

I have already prepared a simple fix that I will pull request shortly

@raydac
Copy link
Owner

raydac commented Sep 9, 2020

ok, thank you
as I see, the problem in com.igormaznitsa.mvngolang.AbstractGoDependencyAwareMojo#restoreGoModFromBackupAndRemoveBackup

@raydac raydac added the bug label Sep 9, 2020
raydac added a commit that referenced this issue Sep 9, 2020
bugfix #73: Backup go.mod file was always written back to src folder inste…
@raydac raydac closed this as completed Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants