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 <pas...@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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to