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