Class PomFileGenerator
java.lang.Object
org.jdrupes.builder.core.AbstractProvider
org.jdrupes.builder.core.AbstractGenerator
org.jdrupes.builder.mvnrepo.PomFileGenerator
- All Implemented Interfaces:
Generator, ResourceProvider
A Generator for POM files. The generator generates a maven
Model with basic information. The group is set to the value
of the property MvnProperties.GroupId if it is defined. The
artifact id is set to the property MvnProperties.ArtifactId
or the name of the project, if MvnProperties.ArtifactId is not
defined. The version is set to the value of the property
Project.Properties.Version.
This basic model is passed to adaptPom(Consumer) where it can be adapted.
as the project requires. Finally, the model is written to the
POM file
-
Field Summary
FieldsFields inherited from class AbstractProvider
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAllow derived classes to post process the generated POM.Returns the destination directory.destination(Path destination) Sets the destination directory.destination(Supplier<Path> destination) Sets the destination directory.doProvide(ResourceRequest<T> requested) Invoked byAbstractProvider.provide(ResourceRequest)after checking if the invocation is allowed.Methods inherited from class AbstractProvider
provideMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ResourceProvider
provide
-
Field Details
-
GENERATED_BY
-
-
Constructor Details
-
PomFileGenerator
Instantiates a new library generator.- Parameters:
project- the project
-
-
Method Details
-
destination
Returns the destination directory. Defaults to sub directorypublications/mavenin the project's build directory (seeProject.buildDirectory()).- Returns:
- the destination
-
destination
Sets the destination directory. ThePathis resolved against the project's build directory (seeProject.buildDirectory()).- Parameters:
destination- the new destination- Returns:
- the jar generator
-
destination
Sets the destination directory.- Parameters:
destination- the new destination- Returns:
- the jar generator
-
doProvide
Description copied from class:AbstractProviderInvoked byAbstractProvider.provide(ResourceRequest)after checking if the invocation is allowed.- Specified by:
doProvidein classAbstractProvider- Type Parameters:
T- the generic type- Parameters:
requested- the requested- Returns:
- the stream
-
adaptPom
Allow derived classes to post process the generated POM.- Parameters:
adaptor- the adaptor- Returns:
- the pom file generator
-