It's not perfect, but it's a start. For example, the choices are hard coded in the script. And when I tab after typing mvn assem it outputs mvn assembly\:assembly. Shouldn't be too hard to find that extra slash.
Here are some thoughts on how one could improve it. First, maybe it could be improved for at least the core plugins by searching the local repo in /m2/repository/org/apache/maven/plugins. Or searching the local repo for any pom that contains a packing value of maven-plugin (
For example, you can get everything you need for any plugin if you know the groupId and artifactid by running this:
mvn help:describe -DgroupId=org.apache.maven.plugins -DartifactId=maven-war-plugin -Dfull=true
I say all this, but I use a lot of alias's for my maven commands. Here are a few of my favorites:
alias mci='mvn clean install'
alias build='mvn clean install -Dmaven.test.skip=true -Dpmd.skip=true -Dcheckstyle.skip=true'
I've fixed the slash on colons and (IMHO) made it easier to add commands.
ReplyDeleteI also added some setup stuff for Mac/Win users who aren't accustomed to the sweet life we enjoy with Linux :-)
Take a look:
http://willcode4beer.com/tips.jsp?set=tabMaven
IMO using help plugin would be to much resource consuming as it needs to run maven which itself is a bit slow.
ReplyDeleteIn this case I prefer more brute-force approach ;-)
It took me some time and work, but I think the result was worth the effort.
Of course it still needs some attention (the idea of searching the local repository seems interesting).