[Solved] List all of the possible goals in Maven 2? (2023)

java maven-2

121,120

Solution 1

The goal you indicate in the command line is linked to the lifecycle of Maven. For example, the build lifecycle (you also have the clean and site lifecycles which are different) is composed of the following phases:

  • validate: validate the project is correct and all necessary information is available.
  • compile: compile the source code of the project.
  • test: test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed.
  • package: take the compiled code and package it in its distributable format, such as a JAR.
  • integration-test: process and deploy the package if necessary into an environment where integration tests can be run.
  • verify: run any checks to verify the package is valid and meets quality criteria
  • install: install the package into the local repository, for use as a dependency in other projects locally.
  • deploy: done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.

You can find the list of "core" plugins here, but there are plenty of others plugins, such as the codehaus ones, here.

Solution 2

Is it possible to list all of the possible goals (including, say, all the plugins) that it is possible to run?

Maven doesn't have anything built-in for that, although the list of phases is finite (the list of plugin goals isn't since the list of plugins isn't).

But you can make things easier and leverage the power of bash completion (using cygwin if you're under Windows) as described in the Guide to Maven 2.x auto completion using BASH (but before to choose the script from this guide, read further).

To get things working, first follow this guide to setup bash completion on your computer. Then, it's time to get a script for Maven2 and:

  • While you could use the one from the mini guide
  • While you use an improved version attached to MNG-3928
  • While you could use a random scripts found around the net (see the resources if you're curious)
  • I personally use the Bash Completion script from Ludovic Claude's PPA (which is bundled into the packaged version of maven in Ubuntu) that you can download from the HEAD. It's simply the best one.

Below, here is what I get just to illustrate the result:

$ mvn [tab][tab]Display all 377 possibilities? (y or n)ant:ant ant:clean ant:help antrun:help antrun:run archetype:crawl archetype:create archetype:create-from-project archetype:generate archetype:help assembly:assembly assembly:directory assembly:directory-single assembly:help assembly:single ... 

Of course, I never browse the 377 possibilities, I use completion. But this gives you an idea about the size of "a" list :)

Resources

Solution 3

Strange nobody listed an actual command to do it:

mvn help:describe -e -Dplugin=site

If you want to list all goals of the site plugin. Output:

Name: Apache Maven Site Plugin Description: The Maven Site Plugin is aplugin that generates a site for the current project. Group Id:org.apache.maven.plugins Artifact Id: maven-site-plugin Version: 3.7.1Goal Prefix: site

This plugin has 9 goals:

site:attach-descriptor Description: Adds the site descriptor(site.xml) to the list of files to beinstalled/deployed.For Maven-2.x this is enabled by default only when the project has pompackaging since it will be used by modules inheriting, but this can beenabled for other projects packaging if needed.This default execution has been removed from the built-in lifecycle ofMaven 3.x for pom-projects. Users that actually use those projects toprovide a common site descriptor for sub modules will need to explicitlydefine this goal execution to restore the intended behavior.

site:deploy Description: Deploys the generated site using wagonsupported protocols tothe site URL specified in the section of the POM.For scp protocol, the website files are packaged by wagon into zip archive,then the archive is transfered to the remote host, next it is un-archivedwhich is much faster than making a file by file copy.

site:effective-site Description: Displays the effective sitedescriptor as an XML for thisbuild, after inheritance and interpolation of site.xml, for the firstlocale.

site:help Description: Display help information onmaven-site-plugin.Call mvn site:help -Ddetail=true -Dgoal= to display parameterdetails.

site:jar Description: Bundles the site output into a JAR so that itcan be deployedto a repository.

site:run Description: Starts the site up, rendering documents asrequested forfaster editing. It uses Jetty as the web server.

site:site Description: Generates the site for a single project.Note that links between module sites in a multi module build will not work,since local build directory structure doesn't match deployed site.

site:stage Description: Deploys the generated site to a localstaging or mockdirectory based on the site URL specified in the section of the POM.It can be used to test that links between module sites in a multi-modulebuild work.

This goal requires the site to already have been generated using the sitegoal, such as by calling mvn site.

site:stage-deploy Description: Deploys the generated site to astaging or mock URL to thesite URL specified in the section of the POM,using wagon supported protocols

For more information, run 'mvn help:describe [...] -Ddetail'

More details on https://mkyong.com/maven/how-to-display-maven-plugin-goals-and-parameters/

Solution 4

If you use IntelliJ IDEA you can browse all maven goals/tasks (including plugins) in Maven Projects tab:

[Solved] List all of the possible goals in Maven 2? (1)

View more solutions

Share:

121,120

Related videos on Youtube

[Solved] List all of the possible goals in Maven 2? (2)

(Video) BUILD FAILURE Plugin org.apache.maven.plugins: or one of its dependencies could not be resolved..

02 : 00

Maven Tutorial - Goals in Maven

QASCRIPT

866

Maven phần 3 - Hướng dẫn về các Maven goals: clean, compile, package, install, deploy

Yêu lập trình

556

[Solved] List all of the possible goals in Maven 2? (4)

13 : 54

Maven Tutorial 03- Maven Build Phases

Java Brains

305

[Solved] List all of the possible goals in Maven 2? (5)

45 : 22

What's cooking in Maven? (Maarten Mulders)

Devoxx FR

285

[Solved] List all of the possible goals in Maven 2? (6)

07 : 17

(Video) How to resolve compiler errors while running Maven Project from Eclipse & CMD line | Fix Maven Error

Maven phases vs. goals: the key differences

Beyond Java

271

[Solved] List all of the possible goals in Maven 2? (7)

12 : 25

31# Maven Life Cycle - Phases-Plugins-Goals II Selenium Automation #Maven#SeleniumAutomationwithJava

Knowledge Share

185

[Solved] List all of the possible goals in Maven 2? (8)

03 : 34

Maven Lifecycle Phases and Goals

Bharath thippireddy

43

[Solved] List all of the possible goals in Maven 2? (9)

45 : 07

Jenkins Nexus Upload artifact from jenkins to nexus using maven

DevopsByShobhan

21

[Solved] List all of the possible goals in Maven 2? (10)

01 : 04 : 39

Instagram Bringing NFTs to 2.9B People | Sandeep & Mihailo, Polygon

Bankless

9

(Video) Solution # 2 | How to Solve Maven Build Error

[Solved] List all of the possible goals in Maven 2? (11)

15 : 04

Maven Lifecycle In 15 minutes | Phases | Goals | Plugins | Profiles

Nikolay Panyukov

3

[Solved] List all of the possible goals in Maven 2? (12)

Author by

Noel M

Updated on July 08, 2022

Comments

  • [Solved] List all of the possible goals in Maven 2? (13)

    Noel M 7 months

    I'm new to Maven, coming from the Ant world.

    Is it possible to list all of the possible goals (including, say, all the plugins) that you can run?

    I can see that there used to be a -g flag in Maven 1, but this isn't available in version 2.

  • [Solved] List all of the possible goals in Maven 2? (16)

    (Video) #Jenkins - 5 | How to solve maven compilation failure in Jenkins/Eclipse | NATASA Tech

    Salandur over 12 years

    have a look at the Lifecycle Reference. All lifecycle parts are listed there.

  • [Solved] List all of the possible goals in Maven 2? (17)

    Romain Linsolas over 12 years

    Didn't had a look at it yet, but does the new Maven Shell tool provide a auto completion, that could be usefull here?

  • [Solved] List all of the possible goals in Maven 2? (18)

    Devanshu Mevada over 12 years

    @romain No, mvnsh doesn't provide completion (at least not in the version I have on my machine). I checked before answering :)

  • [Solved] List all of the possible goals in Maven 2? (19)

    nacho4d over 5 years

    I would like to do this via some command. How IntelliJ IDEA does it?

  • [Solved] List all of the possible goals in Maven 2? (20)

    user1708042 almost 2 years

    e.g for spring boot: mvn help:describe -e -Dplugin=spring-boot

Recents

Why Is PNG file with Drop Shadow in Flutter Web App Grainy?

How to troubleshoot crashes detected by Google Play Store for Flutter app

Cupertino DateTime picker interfering with scroll behaviour

Why does awk -F work for most letters, but not for the letter "t"?

Flutter change focus color and icon color but not works

How to print and connect to printer using flutter desktop via usb?

Critical issues have been reported with the following SDK versions: com.google.android.gms:play-services-safetynet:17.0.0

Flutter Dart - get localized country name from country code

navigatorState is null when using pushNamed Navigation onGenerateRoutes of GetMaterialPage

Android Sdk manager not found- Flutter doctor error

Flutter Laravel Push Notification without using any third party like(firebase,onesignal..etc)

(Video) Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compil

How to change the color of ElevatedButton when entering text in TextField

FAQs

What are all the Maven goals? ›

Maven Build Phases
  • validate.
  • compile.
  • test.
  • package.
  • verify.
  • install.
  • deploy.
Aug 3, 2022

What is the correct answers for advantages of Maven? ›

The features or advantages of Maven are as follows:

Maven maintains a uniform directory structure across the organization. Both the deployment and build activities are taken care by Maven. Maven is simple, easy to grasp, to set up and utilize in the projects as it is driven by the POM file.

How do you write goals in Maven? ›

From the main menu, select Run | Edit Configurations to open the run/debug configuration for your project. In the list that opens, select Run Maven Goal. In the Select Maven Goal dialog, specify a project and a goal that you want to execute before launching the project. Click OK.

What are the goals in default life cycle in Maven? ›

Given the lifecycle phases above, this means that when the default lifecycle is used, Maven will first validate the project, then will try to compile the sources, run those against the tests, package the binaries (e.g. jar), run integration tests against that package, verify the integration tests, install the verified ...

What is Maven goals and profiles? ›

A Build profile is a set of configuration values, which can be used to set or override default values of Maven build. Using a build profile, you can customize build for different environments such as Production v/s Development environments. Profiles are specified in pom.

What is Maven site goal? ›

Goals Overview

site:site is used generate a site for a single project. Note that links between module sites in a multi module build will not work, since local build directory structure doesn't match deployed site.

How do you explain Maven in an interview? ›

Maven is a robust project management tool based on the POM architecture (project object model). It is used for project build, as well as for managing dependencies and documentation. In simple terms, Maven is a tool that can be used to create and manage any Java-based project.

What are the correct types of Maven? ›

According to Apache Maven, there are 2 types of maven plugins.
  • Build Plugins.
  • Reporting Plugins.

Which of the following are the critical goals in Maven for test automation? ›

Maven has a number of “goals” that represent a specific task for building and managing a project. There are a number of goals present in Maven, but three are crucial for Selenium test automation. They clean, install, and test.

How do you list your goals? ›

First consider what you want to achieve, and then commit to it. Set SMART (specific, measureable, attainable, relevant and time-bound) goals that motivate you and write them down to make them feel tangible. Then plan the steps you must take to realize your goal, and cross off each one as you work through them.

How do you write a list of goals? ›

How to Write Effective Goals
  1. Make it Actionable. Use a verb when writing your goal. ...
  2. Assign an Accountable Goal Owner. ...
  3. Establish Timing. ...
  4. Clearly Define Success. ...
  5. Connect to Why. ...
  6. Break it Down into Milestone Actions.
Jan 30, 2023

Which is not a goal of Maven? ›

Which of the following is not a maven goal? Explanation: clean, package, install are maven goals. Debug is used finding and resolving of defects.

Which is the correct Maven goals that can be used to explain the usage of a Maven plugin? ›

The describe goal is used to discover information about Maven plugins.

What are the goals of the Maven deploy plugin? ›

Goals Overview

deploy:deploy is used to automatically install the artifact, its pom and the attached artifacts produced by a particular project. Most if not all of the information related to the deployment is stored in the project's pom. deploy:deploy-file is used to install a single artifact along with its pom.

How do I create a goal and profile in Maven? ›

You can add custom build configurations and specify other goals.
  1. Right-click the pom. ...
  2. Right-click Maven Build, and click New. ...
  3. Enter a configuration name, and click Select to select the goals you want to run. ...
  4. Click Variables on the Run Configuration window to select a variable for the base directory.

How to set goals for Maven in Eclipse? ›

First of all, select the project and go to “Run As -> Maven Build”. The “Edit Configuration” popup window will open. Enter the “Goals” as “package” to build the project and click on the Run button.

How do I specify Maven goals in Jenkins? ›

I. Configure Maven in Jenkins
  1. Go to Jenkins Dashboard ->Manage Jenkins ->Manage plugins ->Available ->Maven Integration ->Install.
  2. Go to Manage Jenkins->Global tool configuration->Maven -> Add Maven_home variable value (i.e. path of the maven file on your system).
Jun 4, 2020

Is clean a Maven goal? ›

Goals Overview

clean:clean attempts to clean a project's working directory of the files that we're generated at build-time. By default, it discovers and deletes the directories configured in project. build. directory , project.

What is a typical Maven goal Command to execute unit tests? ›

We can run our unit tests with Maven by using the command: mvn clean test. When we run this command at command prompt, we should see that the Maven Surefire Plugin runs our unit tests.

Why do we use Maven goal Clean install? ›

mvn clean install tells Maven to do the clean phase in each module before running the install phase for each module. What this does is clear any compiled files you have, making sure that you're really compiling each module from scratch.

What is Maven with example? ›

Maven is a popular open-source build tool that the Apache Group developed for building, publishing, and deploying several projects. Maven is written in Java and is used to create projects written in C#, Scala, Ruby, and so on. The tool is used to build and manage any Java-based project.

Can you explain the Maven life cycle? ›

Maven Build Life Cycle of Default Phase

Compile: This command compiles the project's source code. Test: Test the compiled source code with an appropriate unit testing framework. These tests should not require code packaging or deployment. Package: Package the compiled code in a distributable format, such as a JAR.

What are the common issues in Maven? ›

Let's look into the most common:
  • Dependencies are not built in the local repository. You may have Module A and Module B. ...
  • Dependency version is not correct. This can be so simply as to change the version of the dependency that you are using, or a real pain to figure it out. ...
  • Remote repository has overwritten your changes.
Sep 24, 2014

How many types of Maven are there? ›

There are 3 types of maven repository: Local Repository. Central Repository. Remote Repository.

How many phases do we have in Maven? ›

Well, Maven executed 3 phases: compile phase and the bound compile goal from the compiler plugin. test phase and the bound test goal from the surefire plugin. package phase and the bound jar goal from the jar plugin.

What is goal in Maven terminology? ›

A - A goal represents a specific task which contributes to the building and managing of a project. B - It may be bound to zero or more build phases. C - A goal not bound to any build phase could be executed outside of the build lifecycle by direct invocation.

What are the primary goals of automation? ›

The main objective of process automation is to improve a company's workflows. With automation, we can reduce costs, time, and waste as well as increase productivity, reduce mistakes, and control all the processes of the business in real time.

Which of the following is a goal of automation? ›

The goal of automation is to reduce the number of test cases to be run manually and not eliminate manual testing all together.

What is the goal of test automation? ›

Automated software testing can increase the depth and scope of tests to help improve software quality. Lengthy tests that are often avoided during manual testing can be run unattended. They can even be run on multiple computers with different configurations.

What are different types of goals list and give examples? ›

There are three types of goals- process, performance, and outcome goals.
  • Process goals are specific actions or 'processes' of performing. For example, aiming to study for 2 hours after dinner every day . ...
  • Performance goals are based on personal standard. ...
  • Outcome goals are based on winning.

How do you set goals answer? ›

How to answer “How do you plan to achieve your career goals?”
  1. Get clarity on your path. ...
  2. Make sure it is in line with the job offered. ...
  3. Divide goals into short-term and long-term. ...
  4. Explain your plan of action to achieve it. ...
  5. Make sure you are a cultural fit. ...
  6. Do not mention salary. ...
  7. Do not be vague.
Aug 21, 2020

Can you list the three types of goals? ›

In goal setting, goals are generally classified into three types of goals: outcome, performance and process.

What is a goal example? ›

Examples of goals include: I want to become known as an expert in business strategy. I will commit to my career development and learn how to increase sales. I want to be more confident.

How do you write a goal statement example? ›

Here are some personal goal statement examples to inspire you: “I will become the director of research operations at my company within the next five years. To do this, I will develop my administration and leadership skills and build a positive relationship with the research teams.”

How do you list SMART goals? ›

How to write SMART goals
  1. 5-second summary. Teams often fall short of meeting their goals due to a lack of consensus on the definition of success. ...
  2. Want to get started right now? Use our template to define the different components of your SMART goal.
  3. SPECIFIC. ...
  4. MEASURABLE. ...
  5. ACHIEVABLE. ...
  6. Relevant. ...
  7. time-bound.
Dec 26, 2021

What are types of work goals? ›

Professional goals are mental targets or milestones that keep you focused and on track to succeed in your career. Work goals cover a wide range, from hitting a performance target or having a specific role on a project team to learning a valuable skill or earning a promotion.

What are examples of goal statements for work? ›

Short-term career goal examples

Short-term goal: I want to learn data analytics to expand my marketing knowledge. SMART goal: I will earn a Google Data Analytics Certificate through Coursera within nine months. Short-term goal: I want to become more comfortable speaking in groups.

What are the components of Maven? ›

Shared Components
Shared ComponentVersionDescription
maven-dependency-tree3.2.1Maven Dependency Tree constructs a tree model of a Maven project's dependencies.
maven-doxia-toolsmoved to doxia-integration-tools
maven-filtering3.3.0Components for filtering resources.
maven-invoker3.2.0Fires up a Maven build in a new JVM.
18 more rows
6 days ago

Which of the following is correct about Maven? ›

Q 3 - Which of the following is true about Maven Conventions? A - Maven uses Convention over Configuration which means developers are not required to create build process themselves.

What are the correct types of Maven plugins? ›

Maven has two types of plugins:
  • Build – executed during the build process. Examples include Clean, Install, and Surefire plugins. These should be configured in the build section of the POM.
  • Reporting – executed during site generation to produce various project reports. Examples include Javadoc and Checkstyle plugins.
Mar 13, 2022

What does the Maven clean package goal does during the Maven build? ›

The Maven Clean Plugin, as the name implies, attempts to clean the files and directories generated by Maven during its build. While there are plugins that generate additional files, the Clean Plugin assumes that these files are generated inside the target directory.

What does the goal Maven archetype generate? ›

Goals Overview

archetype:generate creates a Maven project from an archetype: asks the user to choose an archetype from the archetype catalog, and retrieves it from the remote repository. Once retrieved, it is processed to create a working Maven project.

What are Maven goals in Jenkins? ›

Maven helps developers maintain Java-based applications through projects that organize codefiles and build scripts to run compiler tools, version numbers for compiled code, and dependency management that lets one project reference a version of another project.

What is the goal in Maven terminology? ›

Q 5 - Which of the following is true about goal in Maven terminology? A - A goal represents a specific task which contributes to the building and managing of a project.

How to set Maven goals in Jenkins? ›

I. Configure Maven in Jenkins
  1. Go to Jenkins Dashboard ->Manage Jenkins ->Manage plugins ->Available ->Maven Integration ->Install.
  2. Go to Manage Jenkins->Global tool configuration->Maven -> Add Maven_home variable value (i.e. path of the maven file on your system).
Jun 4, 2020

What are the Maven commands? ›

A quick reference to Maven commands.
  • mvn -Dtest=<unqualified-classname> test. Tests only the specified class.
  • mvn -Dmaven. surefire. ...
  • mvn -Dcargo.wait=true -P int integration-test. Runs CS in Tomcat via cargo.
  • mvn help:effective-pom. Shows the logical contents of a pom. ...
  • mvn dependency:tree. ...
  • mvn -X <package-name>

How do I set goals and options in Jenkins? ›

Answer: In Jenkins, navigate to the Build section of the job, then click on Advanced. Settings File option will be visible there. The location of the settings. xml is to be specified there.

How to specify goals for Maven build in Eclipse? ›

First of all, select the project and go to “Run As -> Maven Build”. The “Edit Configuration” popup window will open. Enter the “Goals” as “package” to build the project and click on the Run button.

What is the goal of Maven clean package during the Maven build? ›

The Maven Clean Plugin, as the name implies, attempts to clean the files and directories generated by Maven during its build. While there are plugins that generate additional files, the Clean Plugin assumes that these files are generated inside the target directory.

What are the two types of Maven plugins? ›

In Maven, there are two kinds of plugins, build and reporting:
  • Build plugins are executed during the build and configured in the <build/> element.
  • Reporting plugins are executed during the site generation and configured in the <reporting/> element.
6 days ago

What are the types of Maven plugins in Maven? ›

Maven has two types of plugins:
  • Build – executed during the build process. Examples include Clean, Install, and Surefire plugins. These should be configured in the build section of the POM.
  • Reporting – executed during site generation to produce various project reports. Examples include Javadoc and Checkstyle plugins.
Mar 13, 2022

Videos

1. How to fix failed to execute goal on project
(Hindi Life)
2. How to Resolve the Maven Project Error | Eclipse Maven Project Error
(Suresh SDET Automation)
3. Fix Maven issue with Mule Soft | There was an error running the studio : studio goal on project
(Tech Support & Training)
4. Maven local repository location & how to change it? ||Maven - Change Local Repository Location
(KK JavaTutorials)
5. How To Solve Compiler Error - Source option 5 is no longer supported. Use 7 or later | Selenium
(Mukesh otwani)
6. [Resolved]Maven Compiler Issues
(total-qa)
Top Articles
Latest Posts
Article information

Author: Sen. Ignacio Ratke

Last Updated: 03/22/2023

Views: 5948

Rating: 4.6 / 5 (56 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Sen. Ignacio Ratke

Birthday: 1999-05-27

Address: Apt. 171 8116 Bailey Via, Roberthaven, GA 58289

Phone: +2585395768220

Job: Lead Liaison

Hobby: Lockpicking, LARPing, Lego building, Lapidary, Macrame, Book restoration, Bodybuilding

Introduction: My name is Sen. Ignacio Ratke, I am a adventurous, zealous, outstanding, agreeable, precious, excited, gifted person who loves writing and wants to share my knowledge and understanding with you.