[GitHub] maven-surefire pull request #161: SUREFIRE-1396: Provider class path is inco...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] maven-surefire pull request #161: SUREFIRE-1396: Provider class path is inco...

agudian
Github user Tibor17 commented on a diff in the pull request:

    https://github.com/apache/maven-surefire/pull/161#discussion_r130447743
 
    --- Diff: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java ---
    @@ -2755,7 +2755,16 @@ public Classpath getProviderClasspath()
                 throws ArtifactResolutionException, ArtifactNotFoundException
             {
                 final Map<String, Artifact> pluginArtifactMap = getPluginArtifactMap();
    -            Artifact plugin = pluginArtifactMap.get( "org.apache.maven.plugins:maven-surefire-plugin" );
    +            Class<?> c = AbstractSurefireMojo.this.getClass();
    +            Artifact plugin;
    +            if ( c.getName().equals( "org.apache.maven.plugin.failsafe.IntegrationTestMojo" ) )
    --- End diff --
   
    I guess this is in method `getProviderClasspath()`
    Please split the method in two. First it would call `protected abstract Artifact getMojoArtifact()` and then the original statement `return dependencyResolver.addProviderToClasspath( pluginArtifactMap, plugin );` where `plugin` is `Artifact`. Then force both subclasse to implement `getMojoArtifact` which means surefire mojo will implement it as follows:
    `final Map<String, Artifact> pluginArtifactMap = getPluginArtifactMap();
                Artifact plugin = pluginArtifactMap.get( "org.apache.maven.plugins:maven-surefire-plugin" );`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...