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


##########
api/maven-api-core/src/main/java/org/apache/maven/api/Project.java:
##########
@@ -37,24 +37,103 @@
 @Experimental
 public interface Project {
 
+    /**
+     * Returns the project groupId.
+     */
     @Nonnull
     String getGroupId();
 
+    /**
+     * Returns the project artifactId.
+     */
     @Nonnull
     String getArtifactId();
 
+    /**
+     * Returns the project version.
+     */
     @Nonnull
     String getVersion();
 
+    /**
+     * Returns the project packaging.
+     * <p>
+     * Note: unlike in legacy code, logical checks against string representing 
packaging (returned by this method)
+     * are NOT recommended (code like {@code 
"pom".equals(project.getPackaging)} must be avoided). Use method
+     * {@link #getArtifacts()} to gain access to POM or build artifact.
+     *
+     * @see #getArtifacts()
+     */
     @Nonnull
     String getPackaging();
 
+    /**
+     * Returns the project POM artifact, that is the artifact of the POM of 
this project. Every project have POM
+     * artifact, while the existence of backing POM file is NOT a requirement 
(i.e. for some transient projects).

Review Comment:
   While we're at it, we're missing a paragraph to explain the behaviour in 
case a `ModelParser` is used (for example to parse a POM in a different 
syntax/language). I'll need to have a look at that.



##########
api/maven-api-core/src/main/java/org/apache/maven/api/Project.java:
##########
@@ -37,24 +37,103 @@
 @Experimental
 public interface Project {
 
+    /**
+     * Returns the project groupId.
+     */
     @Nonnull
     String getGroupId();
 
+    /**
+     * Returns the project artifactId.
+     */
     @Nonnull
     String getArtifactId();
 
+    /**
+     * Returns the project version.
+     */
     @Nonnull
     String getVersion();
 
+    /**
+     * Returns the project packaging.
+     * <p>
+     * Note: unlike in legacy code, logical checks against string representing 
packaging (returned by this method)
+     * are NOT recommended (code like {@code 
"pom".equals(project.getPackaging)} must be avoided). Use method
+     * {@link #getArtifacts()} to gain access to POM or build artifact.
+     *
+     * @see #getArtifacts()
+     */
     @Nonnull
     String getPackaging();
 
+    /**
+     * Returns the project POM artifact, that is the artifact of the POM of 
this project. Every project have POM
+     * artifact, while the existence of backing POM file is NOT a requirement 
(i.e. for some transient projects).

Review Comment:
   ```
   Returns the project POM artifact, which is the artifact of the POM of this 
project. Every project have a POM
   artifact, even if the existence of backing POM file is NOT a requirement 
(i.e. for some transient projects).
   ````
   



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