You can use a Gitlab-API wrapper to create your hook. There are some in several languages, I'll use the Ruby wrapper as an example. Adding a hook is as simple as :
h = Gitlab.add_project_hook(project_id, hook_url)
Of course, check first if the hook doesn't already exist. Your url could end with /maven .
Your hook will now trigger a POST request on the url everytime something is pushed to the project repo.
A simple webserver such as Sinatra can now handle the request :
mavenjob.rb
require 'sinatra'
post '/maven' do
'Hook triggered'!
#Handle creation of maven archive
end
You could consider handling POST requests with a queuing system such as Resque. In case you want to go with Ruby there is a Maven wrapper on Github but I've never used it.
Hope it helps!