1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.eclipse.aether.spi.artifact.generator;
20
21 import org.eclipse.aether.RepositorySystemSession;
22 import org.eclipse.aether.deployment.DeployRequest;
23 import org.eclipse.aether.installation.InstallRequest;
24
25 /**
26 * A factory to create artifact generators. Artifact generators can contribute additional artifacts during the
27 * installation/deployment of artifacts.
28 *
29 * @since 2.0.0
30 */
31 public interface ArtifactGeneratorFactory {
32 /**
33 * Artifact property that carries generator id. Generated artifacts should have this property set.
34 */
35 String ARTIFACT_GENERATOR_ID = "artifactGeneratorId";
36
37 /**
38 * Creates a new artifact generator for the specified install request.
39 *
40 * @param session The repository system session from which to configure the generator, must not be {@code null}.
41 * @param request The install request the metadata generator is used for, must not be {@code null}.
42 * @return The artifact generator for the request or {@code null} if none.
43 */
44 ArtifactGenerator newInstance(RepositorySystemSession session, InstallRequest request);
45
46 /**
47 * Creates a new artifact generator for the specified deploy request.
48 *
49 * @param session The repository system session from which to configure the generator, must not be {@code null}.
50 * @param request The deploy request the metadata generator is used for, must not be {@code null}.
51 * @return The artifact generator for the request or {@code null} if none.
52 */
53 ArtifactGenerator newInstance(RepositorySystemSession session, DeployRequest request);
54
55 /**
56 * The priority of this factory. Factories with higher priority are invoked before those with lower priority.
57 *
58 * @return The priority of this factory.
59 */
60 float getPriority();
61 }