private static MavenCoordinates findCompileDependency ( String zipEntryPath , String groupId ) { int apiNameIndex = zipEntryPath . indexOf ( groupId ) ; int extensionIndex = zipEntryPath . lastIndexOf ( ".jar" ) ; if ( apiNameIndex >= 0 && extensionIndex >= 0 ) { String fileNameWithoutExtension = zipEntryPath . substring ( apiNameIndex , extensionIndex ) ; String artifactId = fileNameWithoutExtension . substring ( 0 , fileNameWithoutExtension . lastIndexOf ( "_" ) ) ; String versionId = fileNameWithoutExtension . substring ( fileNameWithoutExtension . lastIndexOf ( "_" ) + 1 , fileNameWithoutExtension . length ( ) ) ; MavenCoordinates coordinates = new MavenCoordinates ( groupId , artifactId , versionId ) ; System . out . println ( "Found compile dependency: " + coordinates ) ; return coordinates ; } return null ; }
Find compile dependency from a zip entry in the ESA