From 744e9bdcbf51b80f4595f77ad88c435ec67a7e5e Mon Sep 17 00:00:00 2001 From: Zhang Zongyu Date: Fri, 4 Sep 2020 20:09:36 +0800 Subject: only detect frameworks when the project has tests. Signed-off-by: Zhang Zongyu --- .../org/gentoo/java/ebuilder/maven/MavenEbuilder.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 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 19fc43c..4a63494 100644 --- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java +++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java @@ -172,14 +172,16 @@ public class MavenEbuilder { final MavenProject mavenProject, final Config config) { Set frameworks = new HashSet<>(10); - for (final MavenDependency dependency : mavenProject. - getTestDependencies()) { - frameworks.add(determineTestingFrameworkByDependency(dependency)); - } + if (mavenProject.hasTests()) { + for (final MavenDependency dependency : mavenProject. + getTestDependencies()) { + frameworks.add(determineTestingFrameworkByDependency(dependency)); + } - for (final MavenDependency dependency : mavenProject. - getCommonDependencies()) { - frameworks.add(determineTestingFrameworkByDependency(dependency)); + for (final MavenDependency dependency : mavenProject. + getCommonDependencies()) { + frameworks.add(determineTestingFrameworkByDependency(dependency)); + } } if (config.hasBinjarUri()) { -- cgit v1.2.3-65-gdbad