* @return an Artifact containing the GAV information in the file
* @throws IOException
*/
GAV getArtifactForStorageItem(StorageFileItem item) throws IOException {
try {
PomArtifactManager mgr = new PomArtifactManager(
this.nexusConfig.getTemporaryDirectory());
mgr.storeTempPomFile(item.getInputStream());
ArtifactCoordinate ac = mgr.getArtifactCoordinateFromTempPomFile();
return new GAV(ac.getGroupId(), ac.getArtifactId(), ac.getVersion());
} catch (Exception e) {
getLogger().warn(
"Error processing POM file for artifact usage data.", ExceptionUtils.getRootCause(e));
return null;