Q:

Combine many Maven goals within a single one

Until now, I'm using the command mvn clean compile hibernate3:hbm2java to launch my program. Is there any way to combine those three goals within a single one, e.g. mvn run or mvn myapp:run?

A:

Another solution that differs completely from my other answer would be to use the exec-maven-plugin with the goal exec:exec.
<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.2.1</version>
            <configuration>
                <executable>mvn</executable>
                <arguments>
                    <argument>clean</argument>
                    <argument>compile</argument>
                    <argument>hibernate3:hbm2java</argument>
                </arguments>
            </configuration>
        </plugin>
    </plugins>
</build>

And then you just run it like this:
mvn exec:exec

By doing it this way you are not changing any of the other plugins and it is not bound to any phases either.

A:

According to the Hibernate3 Maven Plugin site the hbm2java goal binds to the generate-sources phase by default.
And normally you won't have to clean the project, you run incremental builds.
Anyway if you add the maven-clean-plugin and the hibernate3-maven-plugin in your pom.xml you will have it all in one command.
<build>
    <plugins>
        <plugin>
            <artifactId>maven-clean-plugin</artifactId>
            <version>2.5</version>
            <executions>
                <execution>
                    <id>auto-clean</id>
                    <phase>initialize</phase>
                    <goals>
                        <goal>clean</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>hibernate3-maven-plugin</artifactId>
            <version>2.2</version>
            <executions>
                <execution>
                    <id>hbm2java</id>
                    <goals>
                        <goal>hbm2java</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

If you want the hibernate3-maven-plugin to be run after compile then just set the goal to compile since it will always run after default phases.
So to run all your goals with one command just run:
mvn compile

And if you for any reason don't want to clean then just type:
mvn compile -Dclean.skip

A:

You can also define a default goal for Maven build. 
Then your command line call will look like this
mvn

Defining default goal
Add this following lines to your pom.xml:
<build>
    <defaultGoal>clean compile hibernate3:hbm2java</defaultGoal>
</build>

