Package io.micronaut.maven.services
Class CompilerService
java.lang.Object
io.micronaut.maven.services.CompilerService
Provides methods to compile a Maven project.
- Since:
- 1.1
- Author:
- Álvaro Sánchez-Mariscal
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCompilerService
(org.apache.maven.execution.MavenSession mavenSession, ExecutorService executorService, org.apache.maven.project.ProjectDependenciesResolver resolver) -
Method Summary
Modifier and TypeMethodDescriptionbuildClasspath
(List<org.eclipse.aether.graph.Dependency> dependencies) Builds a classpath string for the given dependencies.Compiles the project.org.apache.maven.shared.invoker.InvocationResult
Packages the project by invoking the Jar plugin.List<org.eclipse.aether.graph.Dependency>
resolveDependencies
(org.apache.maven.project.MavenProject runnableProject, String... scopes) Resolves project dependencies for the given scopes.
-
Field Details
-
MAVEN_JAR_PLUGIN
- See Also:
-
-
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
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.MavenInvocationExceptionPackages the project by invoking the Jar plugin.- Returns:
- the invocation result.
- Throws:
org.apache.maven.shared.invoker.MavenInvocationException
-