@Singleton public class CompilerService extends Object
Modifier and Type | Field and Description |
---|---|
static String |
GMAVEN_PLUS_PLUGIN |
static String |
KOTLIN_MAVEN_PLUGIN |
static String |
MAVEN_COMPILER_PLUGIN |
static String |
MAVEN_JAR_PLUGIN |
static String |
MAVEN_RESOURCES_PLUGIN |
Constructor and Description |
---|
CompilerService(org.apache.maven.project.MavenProject mavenProject,
org.apache.maven.execution.MavenSession mavenSession,
ExecutorService executorService,
org.apache.maven.project.ProjectDependenciesResolver resolver) |
Modifier and Type | Method and Description |
---|---|
String |
buildClasspath(List<org.eclipse.aether.graph.Dependency> dependencies)
Builds a classpath string for the given dependencies.
|
Optional<Long> |
compileProject(boolean copyResources)
Compiles the project.
|
org.apache.maven.shared.invoker.InvocationResult |
packageProject()
Packages the project by invoking the Jar plugin.
|
List<org.eclipse.aether.graph.Dependency> |
resolveDependencies(String... scopes)
Resolves project dependencies for the given scopes.
|
Map<String,Path> |
resolveSourceDirectories()
Resolves the source directories by checking the existence of Java, Groovy or Kotlin sources.
|
public static final String MAVEN_COMPILER_PLUGIN
public static final String MAVEN_JAR_PLUGIN
public static final String MAVEN_RESOURCES_PLUGIN
public static final String GMAVEN_PLUS_PLUGIN
public static final String KOTLIN_MAVEN_PLUGIN
@Inject public CompilerService(org.apache.maven.project.MavenProject mavenProject, org.apache.maven.execution.MavenSession mavenSession, ExecutorService executorService, org.apache.maven.project.ProjectDependenciesResolver resolver)
public Optional<Long> compileProject(boolean copyResources)
copyResources
- whether to copy resources to the target directory.public Map<String,Path> resolveSourceDirectories()
public List<org.eclipse.aether.graph.Dependency> resolveDependencies(String... scopes)
public String buildClasspath(List<org.eclipse.aether.graph.Dependency> dependencies)
public org.apache.maven.shared.invoker.InvocationResult packageProject() throws org.apache.maven.shared.invoker.MavenInvocationException
org.apache.maven.shared.invoker.MavenInvocationException
Copyright © 2020–2023 Micronaut. All rights reserved.