gnodet-bot commented on code in PR #1437:
URL: https://github.com/apache/maven/pull/1437#discussion_r4282007719


##########
maven-core/src/main/java/org/apache/maven/project/MavenProject.java:
##########
@@ -256,6 +258,17 @@ public void setPomFile(File file) {
         this.file = file;
     }
 
+    public void setConsumerPomFile(File file) {

Review Comment:
   ⚠️ **Missing Javadoc** — `setPomFile()` (line ~259, immediately above) has a 
doc comment and `@since 3.2.4`. This public API has neither. The fallback in 
`getConsumerPomFile()` (returns `getFile()` when null) is non-obvious and must 
be documented. At minimum:
   
   ```suggestion
       /**
        * Sets the consumer POM file for this project without changing the 
project basedir or the main POM file.
        * <p>Plugins that produce a consumer POM (e.g. flatten-maven-plugin, 
tycho-packaging-plugin) should set this
        * instead of replacing {@link #setFile(File)} so that the original 
build POM remains accessible.</p>
        *
        * @param file the consumer POM file, or {@code null} to reset to the 
default (main POM file)
        * @since 3.9.x
        */
       public void setConsumerPomFile(File file) {
   ```



##########
maven-core/src/main/java/org/apache/maven/project/MavenProject.java:
##########
@@ -256,6 +258,17 @@ public void setPomFile(File file) {
         this.file = file;
     }
 
+    public void setConsumerPomFile(File file) {
+        this.consumerPomFile = file;
+    }
+
+    public File getConsumerPomFile() {
+        if (consumerPomFile == null) {
+            return getFile();
+        }

Review Comment:
   ⚠️ **Missing Javadoc** — document the fallback behaviour explicitly:
   
   ```suggestion
       /**
        * Returns the consumer POM file for this project.
        * <p>If no consumer POM has been set via {@link 
#setConsumerPomFile(File)}, this method returns
        * {@link #getFile()} as a backward-compatible default.</p>
        *
        * @return the consumer POM file, never {@code null} as long as the 
project has a POM file set
        * @since 3.9.x
        */
       public File getConsumerPomFile() {
   ```



-- 
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