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