code: private List<String> copyDependencies(File javaDirectory) throws MojoExecutionException {
          ArtifactRepositoryLayout layout = new DefaultRepositoryLayout();
  
          List<String> list = new ArrayList<String>();
  
          // First, copy the project's own artifact
          File artifactFile = project.getArtifact().getFile();
          list.add(layout.pathOf(project.getArtifact()));
  
          try {
              FileUtils.copyFile(artifactFile, new File(javaDirectory, layout.pathOf(project.getArtifact())));
          } catch (IOException ex) {
              throw new MojoExecutionException("Could not copy artifact file " + artifactFile + " to " + javaDirectory, ex);
          }
  
          if (excludeDependencies) {
              // skip adding dependencies from project.getArtifacts()
              return list;
          }
  
          for (Artifact artifact : project.getArtifacts()) {
              File file = artifact.getFile();
              File dest = new File(javaDirectory, layout.pathOf(artifact));
  
              getLog().debug("Adding " + file);
  
              try {
                  FileUtils.copyFile(file, dest);
              } catch (IOException ex) {
                  throw new MojoExecutionException("Error copying file " + file + " into " + javaDirectory, ex);
              }
  
              list.add(layout.pathOf(artifact));
          }
  
          return list;
      }
docs: Copy all dependencies into the $JAVAROOT directory
  
  @param javaDirectory where to put jar files
  @return A list of file names added
  @throws MojoExecutionException