It's ok that support is missing, but should have better errorhandling. You get a nasty null pointer exception from:
List classpathElements = executionResult.getProject().getTestClasspathElements();
I did modify the code to get a better error reporting:
private List getClasspathElements(Configuration configuration, MavenExecutionRequest request)
throws MavenEmbedderException, DependencyResolutionRequiredException {
MavenEmbedder embedder = new MavenEmbedder(configuration);
MavenExecutionResult executionResult = embedder.readProjectWithDependencies(request);
List<Throwable> exs = executionResult.getExceptions();
for (Throwable t : exs ){
t.printStackTrace();
}
List<String> classpathElements = executionResult.getProject().getTestClasspathElements();
return classpathElements;
}
I didn't have time to make the code give an exception if user has configured a localrepository in settings.xml. Sorry :-)
It's ok that support is missing, but should have better errorhandling. You get a nasty null pointer exception from: List classpathElements = executionResult.getProject().getTestClasspathElements();
I did modify the code to get a better error reporting:
private List getClasspathElements(Configuration configuration, MavenExecutionRequest request)
throws MavenEmbedderException, DependencyResolutionRequiredException {
}
I didn't have time to make the code give an exception if user has configured a localrepository in settings.xml. Sorry :-)