Skip to content

Commit 92b9e45

Browse files
committed
Rename coordinate -> coordinates and ResolvedArtifact -> DownloadedArtifact
1 parent 13e6d85 commit 92b9e45

File tree

53 files changed

+534
-460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+534
-460
lines changed

api/maven-api-core/src/main/java/org/apache/maven/api/Artifact.java

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@
2323
import org.apache.maven.api.annotations.Nonnull;
2424

2525
/**
26-
* Pointer to a resolved resource such as a <abbr>JAR</abbr> file or <abbr>WAE</abbr> application.
27-
* Each {@code Artifact} instance is basically an exact pointer to a file in a Maven repository.
28-
* {@code Artifact} instances are created when <dfn>resolving</dfn> {@link ArtifactCoordinate} instances.
26+
* A Maven artifact is a file, typically a JAR, that is produced and used by Maven projects.
27+
* It is identified by a unique combination of a group ID, artifact ID, version, classifier,
28+
* and extension, and it is stored in a repository for dependency management and build purposes.
29+
*
30+
* <p>Each {@code Artifact} instance is basically an exact pointer to a file in a Maven repository.
31+
* {@code Artifact} instances are created when <dfn>resolving</dfn> {@link ArtifactCoordinates} instances.
2932
* Resolving is the process that selects a {@linkplain #getVersion() particular version}
30-
* and downloads the artifact in the local repository. This operation returns a {@link ResolvedArtifact}.
33+
* and downloads the artifact in the local repository. This operation returns a {@link DownloadedArtifact}.
34+
* </p>
3135
*
3236
* @since 4.0.0
3337
*/
@@ -38,7 +42,7 @@ public interface Artifact {
3842
* {@return a unique identifier for this artifact}.
3943
* The identifier is composed of groupId, artifactId, extension, classifier, and version.
4044
*
41-
* @see ArtifactCoordinate#getId()
45+
* @see ArtifactCoordinates#getId()
4246
*/
4347
@Nonnull
4448
default String key() {
@@ -56,26 +60,26 @@ default String key() {
5660
/**
5761
* {@return the group identifier of the artifact}.
5862
*
59-
* @see ArtifactCoordinate#getGroupId()
63+
* @see ArtifactCoordinates#getGroupId()
6064
*/
6165
@Nonnull
6266
String getGroupId();
6367

6468
/**
6569
* {@return the identifier of the artifact}.
6670
*
67-
* @see ArtifactCoordinate#getArtifactId()
71+
* @see ArtifactCoordinates#getArtifactId()
6872
*/
6973
@Nonnull
7074
String getArtifactId();
7175

7276
/**
73-
* {@return the version of the artifact}. Contrarily to {@link ArtifactCoordinate},
77+
* {@return the version of the artifact}. Contrarily to {@link ArtifactCoordinates},
7478
* each {@code Artifact} is associated to a specific version instead of a range of versions.
7579
* If the {@linkplain #getBaseVersion() base version} contains a meta-version such as {@code SNAPSHOT},
7680
* those keywords are replaced by, for example, the actual timestamp.
7781
*
78-
* @see ArtifactCoordinate#getVersionConstraint()
82+
* @see ArtifactCoordinates#getVersionConstraint()
7983
*/
8084
@Nonnull
8185
Version getVersion();
@@ -93,7 +97,7 @@ default String key() {
9397
* Returns the classifier of the artifact.
9498
*
9599
* @return the classifier or an empty string if none, never {@code null}
96-
* @see ArtifactCoordinate#getClassifier()
100+
* @see ArtifactCoordinates#getClassifier()
97101
*/
98102
@Nonnull
99103
String getClassifier();
@@ -103,7 +107,7 @@ default String key() {
103107
* The dot separator is <em>not</em> included in the returned string.
104108
*
105109
* @return the file extension or an empty string if none, never {@code null}
106-
* @see ArtifactCoordinate#getExtension()
110+
* @see ArtifactCoordinates#getExtension()
107111
*/
108112
@Nonnull
109113
String getExtension();
@@ -117,11 +121,11 @@ default String key() {
117121
boolean isSnapshot();
118122

119123
/**
120-
* {@return coordinate with the same identifiers as this artifact}.
121-
* This is a shortcut for {@code session.createArtifactCoordinate(artifact)}.
124+
* {@return coordinates with the same identifiers as this artifact}.
125+
* This is a shortcut for {@code session.createArtifactCoordinates(artifact)}.
122126
*
123-
* @see org.apache.maven.api.Session#createArtifactCoordinate(Artifact)
127+
* @see org.apache.maven.api.Session#createArtifactCoordinates(Artifact)
124128
*/
125129
@Nonnull
126-
ArtifactCoordinate toCoordinate();
130+
ArtifactCoordinates toCoordinates();
127131
}

api/maven-api-core/src/main/java/org/apache/maven/api/ArtifactCoordinate.java renamed to api/maven-api-core/src/main/java/org/apache/maven/api/ArtifactCoordinates.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
import org.apache.maven.api.annotations.Nonnull;
2424

2525
/**
26-
* Partial identification of an {@code Artifact} in a Maven repository.
27-
* Each {@code ArtifactCoordinate} instance is basically a pointer to a file in the Maven repository,
26+
* Partial identification of an {@link Artifact} in a Maven repository.
27+
* Each {@code ArtifactCoordinates} instance is basically a pointer to a file in the Maven repository,
2828
* except that the exact version may not be known yet.
2929
*
3030
* @since 4.0.0
3131
*/
3232
@Experimental
3333
@Immutable
34-
public interface ArtifactCoordinate {
34+
public interface ArtifactCoordinates {
3535
/**
3636
* {@return the group identifier of the artifact}.
3737
*/

api/maven-api-core/src/main/java/org/apache/maven/api/Dependency.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import org.apache.maven.api.annotations.Nonnull;
2424

2525
/**
26-
* A result of collecting, flattening and resolving {@code DependencyCoordinate}s.
26+
* A result of collecting, flattening and resolving {@link DependencyCoordinates}s.
2727
* Dependency is the output of the <dfn>collection</dfn> process, which builds the graph of dependencies,
2828
* followed by <dfn>flattening</dfn> and <dfn>resolution</dfn>.
2929
* The version selection is done for each dependency during the collection phase.
@@ -40,7 +40,7 @@ public interface Dependency extends Artifact {
4040
* a modular-<abbr>JAR</abbr> if it is intended to be placed on the module-path,
4141
* a <abbr>JAR</abbr> containing test classes, <i>etc.</i>
4242
*
43-
* @see DependencyCoordinate#getType()
43+
* @see DependencyCoordinates#getType()
4444
*/
4545
@Nonnull
4646
Type getType();
@@ -49,25 +49,25 @@ public interface Dependency extends Artifact {
4949
* {@return the time at which the dependency will be used}.
5050
* If may be, for example, at compile time only, at run time or at test time.
5151
*
52-
* @see DependencyCoordinate#getScope()
52+
* @see DependencyCoordinates#getScope()
5353
*/
5454
@Nonnull
5555
DependencyScope getScope();
5656

5757
/**
5858
* Returns whether the dependency is optional or mandatory.
59-
* Contrarily to {@link DependencyCoordinate}, the obligation of a {@code Dependency} is always present.
59+
* Contrarily to {@link DependencyCoordinates}, the obligation of a {@code Dependency} is always present.
6060
* The value is computed during the dependencies collection phase.
6161
*
6262
* @return {@code true} if the dependency is optional, or {@code false} if mandatory
63-
* @see DependencyCoordinate#getOptional()
63+
* @see DependencyCoordinates#getOptional()
6464
*/
6565
boolean isOptional();
6666

6767
/**
68-
* {@return coordinate with the same identifiers as this dependency}
68+
* {@return coordinates with the same identifiers as this dependency}
6969
*/
7070
@Nonnull
7171
@Override
72-
DependencyCoordinate toCoordinate();
72+
DependencyCoordinates toCoordinates();
7373
}

api/maven-api-core/src/main/java/org/apache/maven/api/DependencyCoordinate.java renamed to api/maven-api-core/src/main/java/org/apache/maven/api/DependencyCoordinates.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.apache.maven.api.annotations.Nullable;
2727

2828
/**
29-
* {@code ArtifactCoordinate} completed with information about how the artifact will be used.
29+
* {@code ArtifactCoordinates} completed with information about how the artifact will be used.
3030
* This information include the dependency type (main classes, test classes, <i>etc.</i>),
3131
* a scope (compile-time, run-time <i>etc.</i>), an obligation (whether the dependency
3232
* is optional or mandatory), and possible exclusions for transitive dependencies.
@@ -37,7 +37,7 @@
3737
*/
3838
@Experimental
3939
@Immutable
40-
public interface DependencyCoordinate extends ArtifactCoordinate {
40+
public interface DependencyCoordinates extends ArtifactCoordinates {
4141
/**
4242
* {@return the type of the dependency}. A dependency can be a <abbr>JAR</abbr> file,
4343
* a modular-<abbr>JAR</abbr> if it is intended to be placed on the module-path,

api/maven-api-core/src/main/java/org/apache/maven/api/DependencyScope.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public enum DependencyScope {
5050

5151
/**
5252
* Undefined. When no scope is explicitly given, UNDEFINED will be used, but its meaning will depend on
53-
* whether the DependencyCoordinate is used in dependency management, in which case it means the scope is not
53+
* whether the DependencyCoordinates is used in dependency management, in which case it means the scope is not
5454
* explicitly managed by this managed dependency, or as a real dependency, in which case, the scope
5555
* will default to {@link #COMPILE}.
5656
*/

api/maven-api-core/src/main/java/org/apache/maven/api/ResolvedArtifact.java renamed to api/maven-api-core/src/main/java/org/apache/maven/api/DownloadedArtifact.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,17 @@
2020

2121
import java.nio.file.Path;
2222

23+
import org.apache.maven.api.annotations.Experimental;
24+
import org.apache.maven.api.annotations.Immutable;
25+
2326
/**
2427
* An {@link Artifact} that has been resolved, i.e. downloaded to the local repository.
2528
*
2629
* @since 4.0.0
2730
*/
28-
public interface ResolvedArtifact extends Artifact {
31+
@Experimental
32+
@Immutable
33+
public interface DownloadedArtifact extends Artifact {
2934

3035
/**
3136
* {@return the actual file that has been downloaded in the file system}

api/maven-api-core/src/main/java/org/apache/maven/api/ResolvedDependency.java renamed to api/maven-api-core/src/main/java/org/apache/maven/api/DownloadedDependency.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,14 @@
1818
*/
1919
package org.apache.maven.api;
2020

21-
public interface ResolvedDependency extends Dependency, ResolvedArtifact {}
21+
import org.apache.maven.api.annotations.Experimental;
22+
import org.apache.maven.api.annotations.Immutable;
23+
24+
/**
25+
* A {@link Dependency} that has been resolved, i.e. downloaded to the local repository.
26+
*
27+
* @since 4.0.0
28+
*/
29+
@Experimental
30+
@Immutable
31+
public interface DownloadedDependency extends Dependency, DownloadedArtifact {}

api/maven-api-core/src/main/java/org/apache/maven/api/Exclusion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* A dependency exclusion.
2626
*
2727
* @since 4.0.0
28-
* @see DependencyCoordinate#getExclusions()
28+
* @see DependencyCoordinates#getExclusions()
2929
*/
3030
@Experimental
3131
public interface Exclusion {

api/maven-api-core/src/main/java/org/apache/maven/api/Lifecycle.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@
2727
import org.apache.maven.api.model.Plugin;
2828

2929
/**
30-
* Lifecycle definition
30+
* A Maven lifecycle is a sequence of predefined phases that govern the build process
31+
* of a Maven project. Each phase represents a specific step, such as compiling the
32+
* code, running tests, packaging the project, and deploying it. Executing a phase
33+
* triggers all preceding phases, ensuring that each step of the build process is
34+
* completed in the correct order. The three main lifecycles in Maven are
35+
* {@link #DEFAULT default}, {@link #CLEAN clean}, and {@link #SITE site}, with the
36+
* {@code default} lifecycle being the most commonly used for project builds.
3137
*
3238
* @since 4.0.0
3339
*/

api/maven-api-core/src/main/java/org/apache/maven/api/ProducedArtifact.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.nio.file.Path;
2222

2323
import org.apache.maven.api.annotations.Experimental;
24+
import org.apache.maven.api.annotations.Immutable;
2425

2526
/**
2627
* An {@link Artifact} that is being produced by a {@link Project} during the build.
@@ -42,4 +43,5 @@
4243
* @see org.apache.maven.api.services.ArtifactManager#setPath(ProducedArtifact, Path)
4344
*/
4445
@Experimental
46+
@Immutable
4547
public interface ProducedArtifact extends Artifact {}

0 commit comments

Comments
 (0)