-
Notifications
You must be signed in to change notification settings - Fork 31
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
Looking for mvn-golang example with multi-module using go-module dependency management #60
Comments
I have a multi-module example among examples. Am I correct that you have both maven dependencies and golang module dependencies in your project? |
Yes that is the example, without using mvn-golang dependency and with GO111MODULE=on |
making some experiments but still no success, single module works well but multi-module still can't process "on" , golang team made very strange stupid implementation of module mechanism. internet full of messages "how to read another module from local folder?!" and there is still no good answer for the question |
Thank you for looking into this. I am able to create a POC
|
yes, it looks like that auto-generation of replacement in go.mod is only way to get it working, I will try today to make some autogenerator |
I have made some experiments with preprocessing of go.mod, it adds replace into all such files with relative path, visually looks good but still can't build with
to enable processing and disable removing of generated go.mod after build, may be you can give some recommendations what is wrong in my case |
do you have a sample multi module maven project with GO Module, or I need to come up one? |
looks like that found some solution, may be today will get working version |
I made solution and now go.mod files are supported, there is example of maven-module mixed project, to activate module support you should either add |
How does it work behind the scene? |
it is preprocessing all go.mod files to provide local paths to dependency modules through |
this works from maven perspective, how it will confuse the IDE which would not be able to reference dependencies. Can we have an option to not restore. I am OK with commit changes of go.mod into source control |
restoration of go.mod can be turned off if project property |
I build the provided examples Golang module build with -Dmvn.golang.restore.go.mod=false do see this log
but go.mod are not modified at end of build also, can you set gitignore for go.sum? |
I have moved the message into debugging log |
i am expecting go.mod updated by mvn-golang, but sofar i dont see any update just want to see how you manage to get multi maven modules working with Go mod |
if you have maven mvn-golang dependencies to golang modules then your go.mod will be temporary changed from (example)
to
in the end of work go.mod will be restored to the original one
|
Now I see why you have to restore go.mod file. I have developers :) insist on working with Go command line instead of maven. The only way is to setup go.mod and commit to source control. Best i can do is to have them run maven the first time to populate dependencies, then run Go and cli |
My apology if this is asked at the wrong place.
basically my go-module A depends on mvn-golang package B, and mvn build fails with
xxxxx/yyyy is from my mvn-golang dependency
and xxxx/yyyy does show up under target/.dep/ dir
I do have GO111MODULE = on
The text was updated successfully, but these errors were encountered: