code: private static File artifactToFile(final Artifact artifact) throws IllegalArgumentException {
          if (artifact == null) {
              throw new IllegalArgumentException("ArtifactResult must not be null");
          }
  
          // FIXME: this is not a safe assumption, file can have a different name
          if ("pom.xml".equals(artifact.getFile().getName())) {
  
              String artifactId = artifact.getArtifactId();
              String extension = artifact.getExtension();
              String classifier = artifact.getClassifier();
  
              File root = new File(artifact.getFile().getParentFile(), "target/classes");
              if (!Validate.isNullOrEmpty(classifier) && "tests".equals(classifier)) {
                  // SHRINKRES-102, allow test classes to be packaged as well
                  root = new File(artifact.getFile().getParentFile(), "target/test-classes");
              } else if ("war".equals(artifact.getProperty(ArtifactProperties.TYPE, null))) {
                  // SHRINKRES-263, allow .war files to be packaged as well
                  root = new File(artifact.getFile().getParentFile(), "target/" + artifactId + "-" + artifact.getVersion());
              }
  
              try {
                  File archive = File.createTempFile(artifactId + "-", "." + extension);
                  archive.deleteOnExit();
                  PackageDirHelper.packageDirectories(archive, root);
                  return archive;
              } catch (IOException e) {
                  throw new IllegalArgumentException("Unable to get artifact " + artifactId + " from the classpath", e);
  
              }
  
          } else {
              return artifact.getFile();
          }
      }
docs: Maps an artifact to a file. This allows ShrinkWrap Maven resolver to package reactor related dependencies.