I need to trigger a maven build on a local repository before committing the repository to a Git.
What are the things that I'll need?
I am new to Git so do give me suggestions on how to preform the said operation. Thanks in advance
I need to trigger a maven build on a local repository before committing the repository to a Git.
What are the things that I'll need?
I am new to Git so do give me suggestions on how to preform the said operation. Thanks in advance
You can try and set up a pre-commit hook
The pre-commit hook is run first, before you even type in a commit message. It’s used to inspect the snapshot that’s about to be committed, to see if you’ve forgotten something, to make sure tests run, or to examine whatever you need to inspect in the code.
In your case, the .git/hook/pre-commit
script can trigger a maven build: if that build fails, exit with status 1 and the commit won't be done.
Even though you had trouble making a git pre-commit hook run before, it is possible to call a python script from a hook, even on Windows.
See this Atlassian example for instance.
#!/bin/sh
"C:\Python27\python.exe" "C:\path\to\mytriggers.py" myParams