question: public static boolean hasDependency ( MavenProject project , String groupId ) { Set < Artifact > artifacts = project . getArtifacts ( ) ; if ( artifacts != null ) { for ( Artifact artifact : artifacts ) { String scope = artifact . getScope ( ) ; if ( Objects . equal ( "test" , scope ) ) { continue ; } if ( Objects . equal ( groupId , artifact . getGroupId ( ) ) ) { return true ; } } } return false ; }
target:  Returns true if the maven project has a dependency with the given groupId