Class BuildClasspathMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.dependency.AbstractDependencyMojo
org.apache.maven.plugins.dependency.fromDependencies.AbstractDependencyFilterMojo
org.apache.maven.plugins.dependency.fromDependencies.BuildClasspathMojo
de.iip_ecosphere.platform.tools.maven.dependencies.BuildClasspathMojo
All Implemented Interfaces:
Comparator<org.apache.maven.artifact.Artifact>, org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
BuildPluginClasspathMojo

@Mojo(name="build-classpath", requiresDependencyResolution=TEST, defaultPhase=GENERATE_SOURCES, threadSafe=true) public class BuildClasspathMojo extends org.apache.maven.plugins.dependency.fromDependencies.BuildClasspathMojo
Reused build-classpath Mojo, allowing to prepend/append classpath elements not part of the Maven classpath. Happens for generated platform services.
Author:
Holger Eichelberger, SSE
  • Field Details

    • TO_WIN

      private static final Function<String,String> TO_WIN
    • TO_LINUX

      private static final Function<String,String> TO_LINUX
    • outputFile

      @Parameter(property="mdep.outputFile") private File outputFile
    • pathSeparator

      @Parameter(property="mdep.pathSeparator", defaultValue="") private String pathSeparator
    • prefix

      @Parameter(property="mdep.prefix") private String prefix
    • localRepoProperty

      @Parameter(property="mdep.localRepoProperty", defaultValue="") private String localRepoProperty
    • fileSeparator

      @Parameter(property="mdep.fileSeparator", defaultValue="") private String fileSeparator
    • cleanup

      @Parameter(property="mdep.cleanup", defaultValue="true") private boolean cleanup
    • befores

      @Parameter(required=false) private List<String> befores
    • prepends

      @Parameter(required=false) private List<String> prepends
    • appends

      @Parameter(required=false) private List<String> appends
    • afters

      @Parameter(required=false) private List<String> afters
    • lineSeparator

      @Parameter(property="mdep.lineSeparator", defaultValue="\n") private String lineSeparator
    • rollout

      @Parameter(required=false) private boolean rollout
    • addTestArtifact

      @Parameter(property="mdep.addTestArtifact", defaultValue="false") private boolean addTestArtifact
    • addAppLoader

      @Parameter(property="mdep.addAppLoader", defaultValue="false") private boolean addAppLoader
    • remoteRepositories

      @Parameter(defaultValue="${project.remoteProjectRepositories}", readonly=true) private List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories
    • repoSession

      @Parameter(defaultValue="${repositorySystemSession}", readonly=true) private org.eclipse.aether.RepositorySystemSession repoSession
    • remoteArtifactRepositories

      @Parameter(defaultValue="${project.remoteArtifactRepositories}", readonly=true, required=true) private List<org.apache.maven.artifact.repository.ArtifactRepository> remoteArtifactRepositories
    • repoSystem

      @Component private org.eclipse.aether.RepositorySystem repoSystem
    • oldEntries

      private Set<String> oldEntries
  • Constructor Details

    • BuildClasspathMojo

      public BuildClasspathMojo()
  • Method Details

    • setOutputFile

      public void setOutputFile(File outputFile)
      Overrides:
      setOutputFile in class org.apache.maven.plugins.dependency.fromDependencies.BuildClasspathMojo
    • setFileSeparator

      public void setFileSeparator(String theFileSeparator)
      Overrides:
      setFileSeparator in class org.apache.maven.plugins.dependency.fromDependencies.BuildClasspathMojo
    • setPathSeparator

      public void setPathSeparator(String thePathSeparator)
      Overrides:
      setPathSeparator in class org.apache.maven.plugins.dependency.fromDependencies.BuildClasspathMojo
    • setLocalRepoProperty

      public void setLocalRepoProperty(String localRepoProperty)
      Overrides:
      setLocalRepoProperty in class org.apache.maven.plugins.dependency.fromDependencies.BuildClasspathMojo
    • setPrefix

      public void setPrefix(String thePrefix)
      Overrides:
      setPrefix in class org.apache.maven.plugins.dependency.fromDependencies.BuildClasspathMojo
    • setPrepends

      public void setPrepends(List<String> prepends)
      Sets the prepends.
      Parameters:
      prepends - the prepends
    • setBefores

      public void setBefores(List<String> befores)
      Sets the befores.
      Parameters:
      befores - the befores
    • getBefores

      public List<String> getBefores()
      Returns the befores.
      Returns:
      the befores, may be null
    • readEntries

      static <C extends Collection<String>> C readEntries(String contents, C result)
      Returns the classpath contents as a collection of entries/tokens.
      Type Parameters:
      C - the type of collection
      Parameters:
      contents - the classpath contents
      result - the result collection instance
      Returns:
      the entries in result
    • readEntriesToSet

      static Set<String> readEntriesToSet(String contents)
      Returns the classpath contents as a set of entries/tokens.
      Parameters:
      contents - the classpath contents
      Returns:
      the entries
    • readEntriesToList

      static List<String> readEntriesToList(String contents)
      Returns the classpath contents as a list of entries/tokens.
      Parameters:
      contents - the classpath contents
      Returns:
      the entries
    • copy

      private static List<String> copy(List<String> list, Function<String,String> transform)
      Copies a given list and applies the specific transform function to the elements.
      Parameters:
      list - the list to copy, may be null
      transform - the transform function
      Returns:
      the copied list, null if list is null
    • doExecute

      protected void doExecute() throws org.apache.maven.plugin.MojoExecutionException
      Overrides:
      doExecute in class org.apache.maven.plugins.dependency.fromDependencies.BuildClasspathMojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • adjustTo

      public void adjustTo(Function<String,String> func)
      Adjusts the setup.
      Parameters:
      func - the adjustment function
    • handleSpringLoader

      private void handleSpringLoader()
      Handles the spring loader appends.
    • doExecuteImpl

      private void doExecuteImpl() throws org.apache.maven.plugin.MojoExecutionException
      The actual extended implementation.
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if the execution fails
    • newResolveArtifactProjectBuildingRequest

      public org.apache.maven.project.ProjectBuildingRequest newResolveArtifactProjectBuildingRequest()
      Overrides:
      newResolveArtifactProjectBuildingRequest in class org.apache.maven.plugins.dependency.AbstractDependencyMojo