Class MavenExtensionContainer
java.lang.Object
io.spring.initializr.generator.buildsystem.maven.MavenExtensionContainer
A container for
maven extensions.- Author:
- Niklas Herder, Stephane Nicoll
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidadd(String groupId, String artifactId, Consumer<MavenExtension.Builder> extension) Add aMavenExtensionwith the specifiedgroupIdandartifactIdandConsumerto customize the extension.booleanSpecify if this container has a extension with the specifiedgroupIdandartifactId.booleanisEmpty()Specify if this container is empty.booleanRemove the extension with the specifiedgroupIdandartifactId.values()Returns aStreamof registeredMavenExtensions.
-
Constructor Details
-
MavenExtensionContainer
public MavenExtensionContainer()
-
-
Method Details
-
isEmpty
public boolean isEmpty()Specify if this container is empty.- Returns:
trueif noMavenExtensionis added
-
has
Specify if this container has a extension with the specifiedgroupIdandartifactId.- Parameters:
groupId- the groupId of the extensionartifactId- the artifactId of the extension- Returns:
trueif an item with the specifiedgroupIdandartifactIdexists
-
values
Returns aStreamof registeredMavenExtensions.- Returns:
- a stream of
MavenExtensions
-
add
Add aMavenExtensionwith the specifiedgroupId,artifactId, andversion. If the extension has already been added, only update the version if necessary.- Parameters:
groupId- the groupId of the extensionartifactId- the artifactId of the extensionversion- the version of the extension- See Also:
-
add
Add aMavenExtensionwith the specifiedgroupIdandartifactIdandConsumerto customize the extension. If the extension has already been added, the consumer can be used to further tune the existing extension configuration.- Parameters:
groupId- the groupId of the extensionartifactId- the artifactId of the extensionextension- aConsumerto customize theMavenExtension
-
remove
Remove the extension with the specifiedgroupIdandartifactId.- Parameters:
groupId- the groupId of the extension to removeartifactId- the artifactId of the extension to remove- Returns:
trueif such a extension was registered,falseotherwise
-