Class MavenPluginContainer
java.lang.Object
io.spring.initializr.generator.buildsystem.maven.MavenPluginContainer
A container for
MavenPlugin
s.- Author:
- HaiTao Zhang
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
add
(String groupId, String artifactId, Consumer<MavenPlugin.Builder> plugin) boolean
Specify if this container has a plugin with the specifiedgroupId
andartifactId
.boolean
isEmpty()
Specify if this container is empty.boolean
Remove the plugin with the specifiedgroupId
andartifactId
.values()
Returns aStream
of registeredMavenPlugin
s.
-
Constructor Details
-
MavenPluginContainer
public MavenPluginContainer()
-
-
Method Details
-
isEmpty
public boolean isEmpty()Specify if this container is empty.- Returns:
true
if noMavenPlugin
is added
-
has
Specify if this container has a plugin with the specifiedgroupId
andartifactId
.- Parameters:
groupId
- the groupId of the pluginartifactId
- the artifactId of the plugin- Returns:
true
if an item with the specifiedgroupId
andartifactId
exists
-
values
Returns aStream
of registeredMavenPlugin
s.- Returns:
- a stream of
MavenPlugin
s
-
add
Add aMavenPlugin
with the specifiedgroupId
andartifactId
. Does nothing if the plugin has already been added.- Parameters:
groupId
- the groupId of the pluginartifactId
- the artifactId of the plugin- See Also:
-
add
Add aMavenPlugin
with the specifiedgroupId
andartifactId
andConsumer
to customize the plugin. If the plugin has already been added, the consumer can be used to further tune the existing plugin configuration.- Parameters:
groupId
- the groupId of the pluginartifactId
- the artifactId of the pluginplugin
- aConsumer
to customize theMavenPlugin
-
remove
Remove the plugin with the specifiedgroupId
andartifactId
.- Parameters:
groupId
- the groupId of the plugin to removeartifactId
- the artifactId of the plugin to remove- Returns:
true
if such a plugin was registered,false
otherwise
-