Interface ProjectContributor

All Superinterfaces:
org.springframework.core.Ordered
All Known Implementing Classes:
ApplicationNameContributor, ArtifactIdContributor, CodeRemoverContributor, FolderRenamerContributor, GroupIdRenamerContributor, JavaPackageRenamerContributor, ParameterReplacementContributor, PropertyFilesContributor, TemplateFileRemovalContributor, TemplateFileRenamingContributor, TemplateModuleContributor
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ProjectContributor extends org.springframework.core.Ordered
Inspired by io.spring.initializr.generator.project.contributor.ProjectContributor
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    contribute(Path projectRoot, ProjectRequest projectRequest, ProjectTemplate template)
    This method will be called after the initial code has been checked out from Git.
    default int
     
  • Method Details

    • contribute

      void contribute(Path projectRoot, ProjectRequest projectRequest, ProjectTemplate template) throws IOException
      This method will be called after the initial code has been checked out from Git. Your custom logic has to be implemented here and should do the required changes to files and folders under 'projectRoot'

      The ordering of execution can be set by overriding the getOrder() method.

      Parameters:
      projectRoot - a Path containing the root project folder
      projectRequest - the project request containing the input data
      template - the project template
      Throws:
      IOException
    • getOrder

      default int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered