Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8537657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:57:10+00:00 2026-06-11T10:57:10+00:00

I am working on a project using Maven for which I need two new

  • 0

I am working on a project using Maven for which I need two new phases: ‘analyze’ and ‘eval’ (for different phases of data analysis). I’ve read all the docs I can find, and created versions of components.xml and lifecycle.xml that are as close as I can get to correct, but Maven refuses to run the new phases. (I should emphasize that I have no problem getting my plugins to work, and no problem binding them to the existing phases provided by the default lifecycle. My problem is that the new phases I create seem to be ignored by maven.) What do I need to do to get my new phases to work?

lifecycles.xml:

<lifecycles>
  <lifecycle>
    <id>lenskit</id>
    <phases>
      <phase>
        <id>analyze</id>
        <executions>
          <execution>
            <goals>
              <goal>greet</goal>
            </goals>
          </execution>
        </executions>
      </phase>
      <phase>
        <id>validate</id>
        <executions>
          <execution>
            <goals>
              <goal>greet</goal>
            </goals>
          </execution>
        </executions>
      </phase>
    </phases>
  </lifecycle>
</lifecycles>

components.xml:

<component-set>
  <components>
    <component>
      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
      <role-hint>lenskit</role-hint>
      <implementation>
        org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping
      </implementation>
      <configuration>
         <id>lenskit</id>
         <phases>
            <phase>get-data</phase>
            <phase>analyze</phase>
            <phase>eval</phase>
         </phases>
         <default-phases>
            <verify> org.apache.maven.plugins:maven-resources-plugin:resources </verify>
            <get-data> org.riedl:hello-lenskit-plugin:greet </get-data>
            <analyze> org.riedl:hello-lenskit-plugin:greet </analyze>
            <eval> org.riedl:hello-lenskit-plugin:greet </eval>
            <package> org.riedl:hello-lenskit-plugin:greet </package>
         </default-phases>
      </configuration>
    </component>
  </components>
</component-set>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:57:11+00:00Added an answer on June 11, 2026 at 10:57 am

    One of the wizards on the Maven mailing list pointed me to a complete working example that does exactly what I wanted: it creates a custom lifecycle with phases named whatever you want, and lets you use that lifecycle from the maven command-line. The example is at:

    https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-scm-publish-plugin

    The key missing insight is that the components.xml file must have both a LifecycleMapping component and a Lifecycle component. The correct, working components.xml is below.

    Note that you may only define an additional lifecycle (i.e. additional to the three default lifecycles: the build, clean and site lifecycles). The original lifecycles and their phases will always be present and you cannot include any phases with names that match an existing lifecycle in your new lifecycle, which is too bad, since it makes it more awkward to redefine a complete lifecycle for a project. Still, this is a nice step forward.

    Also, remember that when you use the new lifecycle, you must mark it as an extension:

    <extensions>true</extensions>
    

    so the plugin is allowed to redefine the lifecycle. To indicate that your pom.xml should use the new lifecycle, include the lifecycle name as the “packaging” for your project.

    <component-set>
      <components>
        <component>
          <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
          <role-hint>lenskit</role-hint>
          <implementation>
        org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping
          </implementation>
        </component>
        <component>
          <role>org.apache.maven.lifecycle.Lifecycle</role>
          <implementation>org.apache.maven.lifecycle.Lifecycle</implementation>
          <role-hint>lenskit</role-hint>
          <configuration>
         <id>lenskit</id>
         <phases>
            <phase>get-data</phase>
            <phase>analyze</phase>
            <phase>eval</phase>
         </phases>
         <default-phases>
            <get-data>org.riedl:hello-lenskit-plugin:greet</get-data>
            <analyze>org.riedl:hello-lenskit-plugin:greet</analyze>
            <eval>org.riedl:hello-lenskit-plugin:greet</eval>
         </default-phases>
          </configuration>
        </component>
      </components>
    </component-set>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a maven project which uses seam 2.2.0, hibernate 3.5.0-CR-2 as JPA
Eclipse Helios: 40+ project working set, using maven (mvn-eclipse plugin) to generate eclipse project
I'm working on a project which involves aggregating data from a variety of sources
I am new to Maven and using it to build a project on my
I'm working on an Android project using maven. I searched unsuccessfully on the known
I am using Maven 2.2.1. I have an enterprise java maven project which I
I'm working on a project using Maven as tool. Within the project I have
I'm working on a large existing java project using maven to manage our builds
Just got a strange error. Working on project using JUnit and Maven 3.0.3 I've
I am working on existing Maven Project Which has got 5 modules like <modules>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.