You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2015/05/04 00:07:29 UTC
[2/3] maven-surefire git commit: Surefire should return the project
artifact if the project is JUnit itself
Surefire should return the project artifact if the project is JUnit itself
Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/464a1cc5
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/464a1cc5
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/464a1cc5
Branch: refs/heads/master
Commit: 464a1cc5ceb22d7a853744b1c1eafcdc5bd18758
Parents: 8355fc1
Author: Julien Herr <ju...@alcatel-lucent.com>
Authored: Sun May 3 22:09:12 2015 +0200
Committer: Tibor17 <ti...@lycos.com>
Committed: Sun May 3 23:44:33 2015 +0200
----------------------------------------------------------------------
.../maven/plugin/surefire/AbstractSurefireMojo.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/464a1cc5/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
index 57ad4ee..dd49f56 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
@@ -1757,7 +1757,15 @@ public abstract class AbstractSurefireMojo
private Artifact getJunitArtifact()
{
- return getProjectArtifactMap().get( getJunitArtifactName() );
+ Artifact artifact = getProjectArtifactMap().get( getJunitArtifactName() );
+
+ if ( artifact == null && getJunitArtifactName().equals(
+ project.getArtifact().getGroupId() + ":" + project.getArtifact().getArtifactId() ) )
+ {
+ return project.getArtifact();
+ }
+
+ return artifact;
}
private Artifact getJunitDepArtifact()