ayush-builds-stuff commented on code in PR #14133:
URL: https://github.com/apache/maven/pull/14133#discussion_r4728447273


##########
impl/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProject.java:
##########
@@ -43,74 +43,148 @@
 import org.apache.maven.api.model.Profile;
 import org.apache.maven.impl.MappedCollection;
 import org.apache.maven.impl.MappedList;
+import org.apache.maven.impl.MutableProject;
+import org.apache.maven.model.root.RootLocator;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.SourceQueries;
 import org.apache.maven.project.artifact.ProjectArtifact;
 import org.eclipse.aether.util.artifact.ArtifactIdUtils;
 
+import static java.util.Objects.requireNonNull;
+
 public class DefaultProject implements Project {
 
     private final InternalMavenSession session;
-    private final MavenProject project;
+    private final String groupId;
+    private final String artifactId;
+    private final String version;
     private final Packaging packaging;
+    private final List<org.eclipse.aether.artifact.Artifact> artifacts;
+    private final boolean producesMainArtifact;
+    private final Model model;
+    private final Path pomPath;
+    private final Path basedir;
+    private final Path rootDirectory;
+    private final Project parent;
+    private final List<Profile> effectiveProfiles;
+    private final List<Profile> declaredActiveProfiles;
+    private final List<Profile> effectiveActiveProfiles;
+    private final MutableProject mutableProject;
 
     public DefaultProject(InternalMavenSession session, MavenProject project) {
-        this.session = session;
-        this.project = project;
+        this(session, project, null);
+    }
+
+    private DefaultProject(InternalMavenSession session, MavenProject project, 
MutableProject mutableProject) {

Review Comment:
   
   Addressed in 5bee858476. DefaultProject no longer accepts or retains a 
MavenProject; its constructor now receives v4 state and stores it directly as 
an immutable snapshot.
   
   MutableProject owns the current snapshot together with source roots, 
attached artifacts, and properties, while MavenProject delegates the migrated 
state to that holder. updateProject() and newSnapshot() have also been removed.
   
   The initial conversion from the unchanged v3 builder is now isolated in 
LegacyProjectAdapter as a transitional boundary for later builder-migration PRs 
under #13461.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to