maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milos Kleint <mkle...@gmail.com>
Subject Re: list of phases defined by the lifecycle of a packaging type
Date Mon, 11 Jun 2012 05:15:06 GMT
public List<String> getLifecyclePhases() {

        LifecycleMapping lifecycleMapping =
lookupComponent(LifecycleMapping.class);
        if (lifecycleMapping != null) {
            Set<String> phases = new TreeSet<String>();
            Map<String, Lifecycle> lifecycles =
lifecycleMapping.getLifecycles();
            for (Lifecycle lifecycle : lifecycles.values()) {
                phases.addAll(lifecycle.getPhases().keySet());
            }
            return new ArrayList<String>(phases);
        }

        return Collections.<String>emptyList();
    }

is what we use for certain code completions in netbeans..

Milos

On Sun, Jun 10, 2012 at 9:48 PM, Pascal Rapicault <pascal@rapicault.net> wrote:
> Hi,
>
> Given a packaging type, is there a way to programmatically know all the phases that are
associated with the various lifecycle?
>
> For example during the execution with -X I see the following output. This is pretty much
what I want.
>
> [DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
> [DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
> [DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources,
generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources,
generate-test-resources, process-test-resources, test-compile, process-test-classes, test,
prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify,
install, deploy]
>
> Thx in advance,
>
> Pascal

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message