aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzongyu <zzy2529420793@gmail.com>2020-08-19 16:33:23 +0800
committerzongyu <zzy2529420793@gmail.com>2020-08-19 16:55:39 +0800
commitab9e52a462aa9107adf7fbe6940c8ce01eddde60 (patch)
tree3385b3a898b6801c6a373caf8fe173c8d585552c
parentrecognize and write JAVA_NEEDS_TOOLS automatically (diff)
downloadjava-ebuilder-ab9e52a462aa9107adf7fbe6940c8ce01eddde60.tar.gz
java-ebuilder-ab9e52a462aa9107adf7fbe6940c8ce01eddde60.tar.bz2
java-ebuilder-ab9e52a462aa9107adf7fbe6940c8ce01eddde60.zip
Distinguish "dev-java/junit:0" and "dev-java/junit-4"
Signed-off-by: zongyu <zzy2529420793@gmail.com>
-rw-r--r--src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java b/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java
index c1e84d1..19fc43c 100644
--- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java
+++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java
@@ -12,6 +12,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.Set;
import org.gentoo.java.ebuilder.Config;
+import org.gentoo.java.ebuilder.portage.MavenVersion;
/**
* Generates ebuild from maven project.
@@ -209,7 +210,12 @@ public class MavenEbuilder {
*/
if ("junit".equals(dependency.getGroupId())
&& "junit".equals(dependency.getArtifactId())) {
- return "junit";
+ if (dependency.getMavenVersion().
+ compareTo(new MavenVersion("3.9.9")) < 1) {
+ return "junit";
+ } else {
+ return "junit-4";
+ }
} else if ("org.testng".equals(dependency.getGroupId())
&& "testng".equals(dependency.getArtifactId())) {
return "testng";