lvonk / fitnesse-maven-classpath

Classpath support for Maven Projects
24 stars 38 forks source link

Support for localRepository configuration is not implemented (and no warning is given and bad stuff happens) #1

Open mudnaes opened 14 years ago

mudnaes commented 14 years ago

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 :-)

asikkema commented 13 years ago

I ran into the same bug today. Will see if we can create a patch tomorrow.