[
https://issues.apache.org/jira/browse/MNG-8026?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17810562#comment-17810562
]
ASF GitHub Bot commented on MNG-8026:
-------------------------------------
gnodet commented on code in PR #1391:
URL: https://github.com/apache/maven/pull/1391#discussion_r1465532360
##########
maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifact.java:
##########
@@ -95,7 +97,12 @@ public String getClassifier() {
@Override
public boolean isSnapshot() {
- return DefaultModelVersionParser.checkSnapshot(artifact.getVersion());
+ return artifact.isSnapshot();
Review Comment:
We had this discussion weeks ago, I think we agreed the snapshot knowledge
was not on the artifact. We now have a pluggable `VersionScheme`, I think it
belongs there.
Anyway, I think those changes related to snapshots are unrelated and would
be better in a separate PR to ease the discussion.
##########
api/maven-api-core/src/main/java/org/apache/maven/api/Artifact.java:
##########
@@ -105,6 +105,14 @@ default String key() {
*/
boolean isSnapshot();
+ /**
+ * The artifact properties.
+ *
+ * @return the artifact properties, never {@code null}
+ */
+ @Nonnull
+ ArtifactProperties getArtifactProperties();
Review Comment:
I don't get this change. An `Artifact` is obtained from coordinates and as
no knowledge on how it will be used. The same pointer could point to the same
artifact, but with different `Type`, hence different properties. I think those
do belong to the resolved. `Dependency`
##########
api/maven-api-core/src/main/java/org/apache/maven/api/BuildPathScope.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.api;
+
+import java.util.Collection;
+
+import org.apache.maven.api.annotations.Experimental;
+import org.apache.maven.api.annotations.Immutable;
+import org.apache.maven.api.annotations.Nonnull;
+
+/**
+ * Build path scope.
+ * <p>
+ * Implementation must have {@code equals()} and {@code hashCode()}
implemented, so implementations of this interface
+ * can be used as keys.
+ *
+ * @since 4.0.0
+ */
+@Experimental
+@Immutable
+public interface BuildPathScope {
+ @Nonnull
+ String id();
+
+ @Nonnull
+ Language language();
+
+ @Nonnull
+ Collection<DependencyScope> getDependencyScopes();
Review Comment:
`Set<DependencyScope>` ?
##########
api/maven-api-core/src/main/java/org/apache/maven/api/Packaging.java:
##########
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.api;
+
+import org.apache.maven.api.annotations.Experimental;
+import org.apache.maven.api.annotations.Immutable;
+import org.apache.maven.api.annotations.Nonnull;
+
+/**
+ * Interface representing a Maven project packaging.
+ *
+ * @since 4.0.0
+ */
+@Experimental
+@Immutable
+public interface Packaging {
Review Comment:
I don't see this `Packaging` used. Is the goal to put it on the `Project` ?
##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/LanguageManager.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.api.services;
+
+import java.util.Optional;
+
+import org.apache.maven.api.Language;
+import org.apache.maven.api.Service;
+import org.apache.maven.api.annotations.Nonnull;
+
+public interface LanguageManager extends Service {
+ @Nonnull
+ Optional<Language> lookupLanguageFamily(String id);
+
+ default Language requireLanguageFamily(String id) {
+ return lookupLanguageFamily(id).orElseThrow(() -> new
IllegalArgumentException("Unknown language"));
Review Comment:
The requested language should be in the exception message.
> Maven should define from ground up scopes used with Resolver
> ------------------------------------------------------------
>
> Key: MNG-8026
> URL: https://issues.apache.org/jira/browse/MNG-8026
> Project: Maven
> Issue Type: Task
> Reporter: Tamas Cservenak
> Priority: Major
> Fix For: 4.0.0, 4.0.0-alpha-13
>
>
> See MRESOLVER-471, it is actually role of Maven (as a resolver consumer
> project) to define all these things:
> * supported scopes
> * transformations of scopes to build path scopes
> * fine tune conflict resolution and related things (in session)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)