Running Maven goals from within NetBeans is easy. For example we can right-click on a project and select the Clean and Build option. NetBeans will invoke Maven and use the clean and install goals. We can see in the output window the Maven output for all steps. We can click on the View Maven Build Plan button at the left of the output window. Or we can right-click in the output window and select View Build Plan:
We now get a window with all the steps Maven takes to execute the clean and install goals. We see the different build phase cycles and which plugins are involved. The following screenshot shows a simple example:
When we add a plugin to our
pom.xml and connect it to a Maven build phase we can see this change also in the build plan. We add the following simple plugin definition to our
pom.xml and connect it to the process-resources build phase:
<plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <phase>process-resources</phase> <configuration> <tasks> <echo message="Show build plan."/> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin>
The next screenshot shows how NetBeans displays the build plan:
Notice how NetBeans even shows the structure of the plugin we added.