Hello all

The work on a new maven-compiler-plugin [1] for Maven 4 has reached the following state:

 * All existing JUnit tests pass
 * Integration tests do not yet pass (I'm working on that)
 * Plexus compiler dependency completely removed (replaced by javax.tools)

My current issue is that dependencies of type "test-jar" are lost. I'm not sure if I'm doing something wrong or if this is an issue with Maven core. The code looks like that:

   DependencyResolver resolver = session.getService(DependencyResolver.class);
   DependencyResolverResult dependencies
            .session(session)
            .project(project)
            .pathScope(PathScope.TEST_COMPILE)
            .build());

In a step-by-step debugging, I see that org.apache.maven.internal.impl.AbstractSession.toDependency(…) is invoked for transforming a dependency from Maven model to Aether model as below (line 274):

   new org.eclipse.aether.artifact.DefaultArtifact(
            dependency.getGroupId(),
            dependency.getArtifactId(),
            dependency.getClassifier(),
            dependency.getType().getExtension(),
            dependency.getVersion().toString(),
            null)

I did not saw the "test-jar" anywhere in the copied object, or did I missed something? Or is this code supposed to generate automatically a "tests" classifier when the type is "type-jar"?

Generally speaking, having coexisting models such as Maven and Eclipse Aether with conversions between those models makes more difficult to follow what is happening inside Maven core, and is a risk of data lost. Don't we have an overlap between the following interfaces, and if yes, should we try to reduce the overlap?

 * org.eclipse.aether.graph.Dependency
 * org.apache.maven.api.Dependency
 * org.apache.maven.api.DependencyCoordinate

Thanks,

    Martin

[1]https://github.com/Geomatys/maven-compiler-plugin

Reply via email to