001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.apache.maven.plugins.annotations;
020
021import java.lang.annotation.Documented;
022import java.lang.annotation.ElementType;
023import java.lang.annotation.Inherited;
024import java.lang.annotation.Retention;
025import java.lang.annotation.RetentionPolicy;
026import java.lang.annotation.Target;
027
028/**
029 * Used if your Mojo needs to fork a <a href="/ref/3.0.4/maven-core/lifecycles.html">lifecycle</a>.
030 *
031 * @author Olivier Lamy
032 * @since 3.0
033 */
034@Documented
035@Retention(RetentionPolicy.CLASS)
036@Target(ElementType.TYPE)
037@Inherited
038public @interface Execute {
039    /**
040     * Lifecycle phase to fork. Note that specifying a phase overrides specifying a goal.
041     * For custom lifecycle phase ids use {@link #customPhase()} instead.
042     * Only one of {@link #customPhase()} and {@link #phase()} must be set.
043     * @return the phase
044     */
045    LifecyclePhase phase() default LifecyclePhase.NONE;
046
047    /**
048     * Custom lifecycle phase to fork. Note that specifying a phase overrides specifying a goal.
049     * This element should only be used for non-standard phases. For standard phases rather use {@link #phase()}.
050     * Only one of {@link #customPhase()} and {@link #phase()} must be set.
051     * @return the custom phase id
052     * @since 3.8.0
053     */
054    String customPhase() default "";
055
056    /**
057     * Goal to fork. Note that specifying a phase overrides specifying a goal. The specified <code>goal</code> must be
058     * another goal of the same plugin.
059     * @return the goal
060     */
061    String goal() default "";
062
063    /**
064     * Lifecycle id of the lifecycle that defines {@link #phase()}. Only valid in combination with {@link #phase()}. If
065     * not specified, Maven will use the lifecycle of the current build.
066     *
067     * @see <a href="https://maven.apache.org/maven-plugin-api/lifecycle-mappings.html">Lifecycle Mappings</a>
068     * @return the lifecycle id
069     */
070    String lifecycle() default "";
071}