Skip to content

Commit

Permalink
Add a SpiService marker interface (#1427)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Feb 28, 2024
1 parent a9934f9 commit 24eee1f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import org.apache.maven.api.ExtensibleEnum;

public interface ExtensibleEnumProvider<T extends ExtensibleEnum> {
public interface ExtensibleEnumProvider<T extends ExtensibleEnum> extends SpiService {

Collection<T> provides();
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* 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.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {}

0 comments on commit 24eee1f

Please sign in to comment.