Class CompilerService

java.lang.Object
io.micronaut.maven.services.CompilerService

@Singleton public class CompilerService extends Object
Provides methods to compile a Maven project.
Since:
1.1
Author:
Álvaro Sánchez-Mariscal
  • Field Details

  • Constructor Details

    • CompilerService

      @Inject public CompilerService(org.apache.maven.execution.MavenSession mavenSession, ExecutorService executorService, org.apache.maven.project.ProjectDependenciesResolver resolver)
  • Method Details

    • compileProject

      Compiles the project.
      Returns:
      the last compilation time millis.
    • resolveDependencies

      public List<org.eclipse.aether.graph.Dependency> resolveDependencies(org.apache.maven.project.MavenProject runnableProject, String... scopes)
      Resolves project dependencies for the given scopes.
      Parameters:
      runnableProject - the project to resolve dependencies for.
      scopes - the scopes to resolve dependencies for.
      Returns:
      the list of dependencies.
    • buildClasspath

      public String buildClasspath(List<org.eclipse.aether.graph.Dependency> dependencies)
      Builds a classpath string for the given dependencies.
      Parameters:
      dependencies - the dependencies to build the classpath for.
      Returns:
      the classpath string.
    • packageProject

      public org.apache.maven.shared.invoker.InvocationResult packageProject() throws org.apache.maven.shared.invoker.MavenInvocationException
      Packages the project by invoking the Jar plugin.
      Returns:
      the invocation result.
      Throws:
      org.apache.maven.shared.invoker.MavenInvocationException