001package org.apache.maven.execution; 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 org.apache.maven.settings.Settings; 023import org.apache.maven.toolchain.model.PersistedToolchains; 024 025/** 026 * Assists in populating an execution request for invocation of Maven. 027 * 028 * @author Benjamin Bentmann 029 */ 030public interface MavenExecutionRequestPopulator 031{ 032 033 /** 034 * Copies the values from the given settings into the specified execution request. This method will replace any 035 * existing values in the execution request that are controlled by the settings. Hence, it is expected that this 036 * method is called on a new/empty execution request before the caller mutates it to fit its needs. 037 * 038 * @param request The execution request to populate, must not be {@code null}. 039 * @param settings The settings to copy into the execution request, may be {@code null}. 040 * @return The populated execution request, never {@code null}. 041 * @throws MavenExecutionRequestPopulationException If the execution request could not be populated. 042 */ 043 @Deprecated 044 MavenExecutionRequest populateFromSettings( MavenExecutionRequest request, Settings settings ) 045 throws MavenExecutionRequestPopulationException; 046 047 /** 048 * Copies the values from the given toolchains into the specified execution request. This method will replace any 049 * existing values in the execution request that are controlled by the toolchains. Hence, it is expected that this 050 * method is called on a new/empty execution request before the caller mutates it to fit its needs. 051 * 052 * @param request The execution request to populate, must not be {@code null}. 053 * @param toolchains The toolchains to copy into the execution request, may be {@code null}. 054 * @return The populated execution request, never {@code null}. 055 * @throws MavenExecutionRequestPopulationException If the execution request could not be populated. 056 * @since 3.3.0 057 */ 058 MavenExecutionRequest populateFromToolchains( MavenExecutionRequest request, PersistedToolchains toolchains ) 059 throws MavenExecutionRequestPopulationException; 060 061 /** 062 * Injects default values like plugin groups or repositories into the specified execution request. 063 * 064 * @param request The execution request to populate, must not be {@code null}. 065 * @return The populated execution request, never {@code null}. 066 * @throws MavenExecutionRequestPopulationException If the execution request could not be populated. 067 */ 068 MavenExecutionRequest populateDefaults( MavenExecutionRequest request ) 069 throws MavenExecutionRequestPopulationException; 070 071}