aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Zongyu <zzy2529420793@gmail.com>2020-09-04 20:09:36 +0800
committerZhang Zongyu <zzy2529420793@gmail.com>2020-09-04 20:15:58 +0800
commit744e9bdcbf51b80f4595f77ad88c435ec67a7e5e (patch)
treeed1a6fb8415ce0f6daf5f76b54ed85f993b258df
parentnew switch: --skip-tests (diff)
downloadjava-ebuilder-744e9bdcbf51b80f4595f77ad88c435ec67a7e5e.tar.gz
java-ebuilder-744e9bdcbf51b80f4595f77ad88c435ec67a7e5e.tar.bz2
java-ebuilder-744e9bdcbf51b80f4595f77ad88c435ec67a7e5e.zip
only detect frameworks when the project has tests.
Signed-off-by: Zhang Zongyu <zzy2529420793@gmail.com>
-rw-r--r--src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java16
1 files 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<String> 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()) {