gnodet commented on code in PR #954:
URL: https://github.com/apache/maven/pull/954#discussion_r1073601881


##########
maven-core/src/main/java/org/apache/maven/ReactorReader.java:
##########
@@ -324,4 +309,130 @@ private static boolean isTestArtifact(Artifact artifact) {
         return ("test-jar".equals(artifact.getProperty("type", "")))
                 || ("jar".equals(artifact.getExtension()) && 
"tests".equals(artifact.getClassifier()));
     }
+
+    private File find(Artifact artifact) {
+        Path target = getArtifactPath(artifact);
+        return Files.isRegularFile(target) ? target.toFile() : null;
+    }
+
+    /**
+     * Copy packaged and attached artifacts from this project to the
+     * project local repository.
+     * This allow a subsequent build to resume while still being able
+     * to locate attached artifacts.
+     *
+     * @param project the project to copy artifacts
+     */
+    private void installIntoProjectLocalRepository(MavenProject project) {
+        if (!hasBeenPackagedDuringThisSession(project)) {
+            return;
+        }
+        List<Artifact> artifacts = new ArrayList<>();
+
+        artifacts.add(RepositoryUtils.toArtifact(new 
ProjectArtifact(project)));
+        if (!"pom".equals(project.getPackaging())) {
+            org.apache.maven.artifact.Artifact mavenMainArtifact = 
project.getArtifact();
+            artifacts.add(RepositoryUtils.toArtifact(mavenMainArtifact));
+        }
+        for (org.apache.maven.artifact.Artifact attached : 
project.getAttachedArtifacts()) {
+            artifacts.add(RepositoryUtils.toArtifact(attached));
+        }
+
+        for (Artifact artifact : artifacts) {

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to