Add a SpiService marker interface (#1427)

This commit is contained in:
Guillaume Nodet 2024-02-29 00:32:09 +01:00 committed by GitHub
parent a9934f91fd
commit 24eee1f8e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 32 additions and 3 deletions

View File

@ -22,7 +22,7 @@ import java.util.Collection;
import org.apache.maven.api.ExtensibleEnum;
public interface ExtensibleEnumProvider<T extends ExtensibleEnum> {
public interface ExtensibleEnumProvider<T extends ExtensibleEnum> extends SpiService {
Collection<T> provides();
}

View File

@ -33,7 +33,7 @@ import org.apache.maven.api.services.Source;
* This allows plugging in additional syntaxes for the main model read by Maven when building a project.
*/
@Experimental
public interface ModelParser {
public interface ModelParser extends SpiService {
/**
* Locates the pom in the given directory.

View File

@ -27,7 +27,7 @@ import org.apache.maven.api.annotations.Experimental;
* very early, while there is no session created yet.
*/
@Experimental
public interface PropertyContributor {
public interface PropertyContributor extends SpiService {
/**
* Invoked just before session is created with a mutable map that carries collected user properties so far.
*

View File

@ -0,0 +1,29 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.api.spi;
import org.apache.maven.api.annotations.Consumer;
import org.apache.maven.api.annotations.Experimental;
/**
* Marker interface to indicate services that can be provided by plugins and extensions.
*/
@Experimental
@Consumer
public interface SpiService {}