Map < String , Set < Artifact > > getPackageCompareMap ( Set < Artifact > dependencyArtifacts ) throws MojoExecutionException { if ( dependencyArtifacts == null ) { throw new IllegalArgumentException ( "dependencies must be initialized" ) ; } Map < String , Set < Artifact > > packageCompareMap = new HashMap < String , Set < Artifact > > ( ) ; Set < Artifact > artifactSet = new HashSet < Artifact > ( ) ; artifactSet . add ( project . getArtifact ( ) ) ; packageCompareMap . put ( getAndroidManifestPackageName ( ) , artifactSet ) ; for ( Artifact artifact : dependencyArtifacts ) { String libPackage = extractPackageNameFromAndroidArtifact ( artifact ) ; Set < Artifact > artifacts = packageCompareMap . get ( libPackage ) ; if ( artifacts == null ) { artifacts = new HashSet < Artifact > ( ) ; packageCompareMap . put ( libPackage , artifacts ) ; } artifacts . add ( artifact ) ; } return packageCompareMap ; }
Provides map with all provided dependencies or project itself grouped by package name