Skip to content

Commit

Permalink
feat(#1595): fix qulice suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Dec 20, 2022
1 parent 270b764 commit e922c66
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions eo-maven-plugin/src/main/java/org/eolang/maven/ResolveMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ files, new Coordinates(dep)
*
* @return List of them
* @todo #1595:30 Make method 'deps' testable. For now it's not possible to test
* 'ignoreTransitive=false' branch because it's hard to mock all required fields.
* Maybe we should provide a chance to mock all dependencies related to maven or
* even extract new classes.
* 'ignoreTransitive=false' branch because it's hard to mock all required fields.
* Maybe we should provide a chance to mock all dependencies related to maven or
* even extract new classes.
*/
private Collection<Dependency> deps() {
Iterable<Dependency> deps = new DcsDefault(
Expand All @@ -184,10 +184,9 @@ private Collection<Dependency> deps() {
dependency -> {
final Iterable<Dependency> transitives = new Filtered<>(
dep -> !ResolveMojo.eqTo(dep, dependency)
&& !dep.getScope().contains("test")
&& !dep.getScope().contains("provided")
&& ResolveMojo.isNotRuntimeRequired(dep)
&& !("org.eolang".equals(dep.getGroupId())
&& "eo-runtime".equals(dep.getArtifactId())),
&& "eo-runtime".equals(dep.getArtifactId())),
new DcsDepgraph(
this.project,
this.session,
Expand Down Expand Up @@ -227,6 +226,15 @@ private Collection<Dependency> deps() {
.collect(Collectors.toList());
}

/**
* Check if dependency is not needed at runtime.
* @param dep Maven dependency
* @return True if it's not needed at runtime
*/
private static boolean isNotRuntimeRequired(final Dependency dep) {
return !dep.getScope().contains("test") && !dep.getScope().contains("provided");
}

/**
* Compare with NULL-safety.
* @param left Left
Expand Down

0 comments on commit e922c66

Please sign in to comment.