You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/10/10 20:14:57 UTC

[GitHub] [maven] michael-o commented on a diff in pull request #819: [MNG-7553] Restore compatibility on SettingsBuilder, ToolchainsBuilder and MojoDescriptorCreator

michael-o commented on code in PR #819:
URL: https://github.com/apache/maven/pull/819#discussion_r991605833


##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/SettingsBuilder.java:
##########
@@ -0,0 +1,71 @@
+package org.apache.maven.api.services;
+
+/*
+ * 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.
+ */
+
+import java.nio.file.Path;
+
+import org.apache.maven.api.Service;
+import org.apache.maven.api.Session;
+import org.apache.maven.api.annotations.Nonnull;
+
+/**
+ * Builds the effective settings from a user settings file and/or a global settings file.
+ */
+public interface SettingsBuilder extends Service
+{
+
+    /**
+     * Builds the effective settings of the specified settings files.
+     *
+     * @param request The settings building request that holds the parameters, must not be {@code null}.
+     * @return The result of the settings building, never {@code null}.
+     * @throws SettingsBuilderException If the effective settings could not be built.
+     */
+    @Nonnull
+    SettingsBuilderResult build( @Nonnull SettingsBuilderRequest request );

Review Comment:
   Same question here.



##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/ProjectBuilderResult.java:
##########
@@ -70,7 +70,7 @@
      * @return The problems that were encountered during the project building, can be empty but never {@code null}.
      */
     @Nonnull
-    Collection<ProjectBuilderProblem> getProblems();
+    Collection<BuilderProblem> getProblems();

Review Comment:
   Stupid question: Is it really a problem with the builder or a problem with the build?



##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/SettingsBuilderRequest.java:
##########
@@ -0,0 +1,204 @@
+package org.apache.maven.api.services;
+
+/*
+ * 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.
+ */
+
+import java.nio.file.Path;
+import java.util.Optional;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.annotations.Experimental;
+import org.apache.maven.api.annotations.Immutable;
+import org.apache.maven.api.annotations.Nonnull;
+import org.apache.maven.api.annotations.NotThreadSafe;
+import org.apache.maven.api.annotations.Nullable;
+
+import static org.apache.maven.api.services.BaseRequest.nonNull;
+
+/**
+ * Collects settings that control the building of effective settings.
+ */
+@Experimental
+@Immutable
+public interface SettingsBuilderRequest
+{
+
+    @Nonnull
+    Session getSession();
+
+    /**
+     * Gets the global settings path.
+     *
+     * @return The global settings path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getGlobalSettingsPath();
+
+    /**
+     * Gets the global settings source.
+     *
+     * @return The global settings source or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Source> getGlobalSettingsSource();

Review Comment:
   Javadoc does not match code



##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/SettingsBuilderRequest.java:
##########
@@ -0,0 +1,204 @@
+package org.apache.maven.api.services;
+
+/*
+ * 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.
+ */
+
+import java.nio.file.Path;
+import java.util.Optional;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.annotations.Experimental;
+import org.apache.maven.api.annotations.Immutable;
+import org.apache.maven.api.annotations.Nonnull;
+import org.apache.maven.api.annotations.NotThreadSafe;
+import org.apache.maven.api.annotations.Nullable;
+
+import static org.apache.maven.api.services.BaseRequest.nonNull;
+
+/**
+ * Collects settings that control the building of effective settings.
+ */
+@Experimental
+@Immutable
+public interface SettingsBuilderRequest
+{
+
+    @Nonnull
+    Session getSession();
+
+    /**
+     * Gets the global settings path.
+     *
+     * @return The global settings path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getGlobalSettingsPath();
+
+    /**
+     * Gets the global settings source.
+     *
+     * @return The global settings source or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Source> getGlobalSettingsSource();
+
+    /**
+     * Gets the user settings path.
+     *
+     * @return The user settings path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getUserSettingsPath();
+
+    /**
+     * Gets the user settings source.
+     *
+     * @return The user settings source or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Source> getUserSettingsSource();

Review Comment:
   Javadoc does not match code



##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/SettingsBuilderRequest.java:
##########
@@ -0,0 +1,204 @@
+package org.apache.maven.api.services;
+
+/*
+ * 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.
+ */
+
+import java.nio.file.Path;
+import java.util.Optional;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.annotations.Experimental;
+import org.apache.maven.api.annotations.Immutable;
+import org.apache.maven.api.annotations.Nonnull;
+import org.apache.maven.api.annotations.NotThreadSafe;
+import org.apache.maven.api.annotations.Nullable;
+
+import static org.apache.maven.api.services.BaseRequest.nonNull;
+
+/**
+ * Collects settings that control the building of effective settings.
+ */
+@Experimental
+@Immutable
+public interface SettingsBuilderRequest
+{
+
+    @Nonnull
+    Session getSession();
+
+    /**
+     * Gets the global settings path.
+     *
+     * @return The global settings path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getGlobalSettingsPath();

Review Comment:
   Javadoc does not match code



##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/SettingsBuilderRequest.java:
##########
@@ -0,0 +1,204 @@
+package org.apache.maven.api.services;
+
+/*
+ * 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.
+ */
+
+import java.nio.file.Path;
+import java.util.Optional;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.annotations.Experimental;
+import org.apache.maven.api.annotations.Immutable;
+import org.apache.maven.api.annotations.Nonnull;
+import org.apache.maven.api.annotations.NotThreadSafe;
+import org.apache.maven.api.annotations.Nullable;
+
+import static org.apache.maven.api.services.BaseRequest.nonNull;
+
+/**
+ * Collects settings that control the building of effective settings.
+ */
+@Experimental
+@Immutable
+public interface SettingsBuilderRequest
+{
+
+    @Nonnull
+    Session getSession();
+
+    /**
+     * Gets the global settings path.
+     *
+     * @return The global settings path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getGlobalSettingsPath();
+
+    /**
+     * Gets the global settings source.
+     *
+     * @return The global settings source or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Source> getGlobalSettingsSource();
+
+    /**
+     * Gets the user settings path.
+     *
+     * @return The user settings path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getUserSettingsPath();
+
+    /**
+     * Gets the user settings source.
+     *
+     * @return The user settings source or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Source> getUserSettingsSource();
+
+    @Nonnull
+    static SettingsBuilderRequest build( @Nonnull Session session,
+                                         @Nonnull Source globalSettingsSource,
+                                         @Nonnull Source userSettingsSource )
+    {
+        return builder()
+                .session( nonNull( session, "session can not be null" ) )
+                .globalSettingsSource( nonNull( globalSettingsSource, "globalSettingsSource can not be null" ) )
+                .userSettingsSource( nonNull( userSettingsSource, "userSettingsSource can not be null" ) )
+                .build();

Review Comment:
   cannot



##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/SettingsBuilderRequest.java:
##########
@@ -0,0 +1,204 @@
+package org.apache.maven.api.services;
+
+/*
+ * 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.
+ */
+
+import java.nio.file.Path;
+import java.util.Optional;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.annotations.Experimental;
+import org.apache.maven.api.annotations.Immutable;
+import org.apache.maven.api.annotations.Nonnull;
+import org.apache.maven.api.annotations.NotThreadSafe;
+import org.apache.maven.api.annotations.Nullable;
+
+import static org.apache.maven.api.services.BaseRequest.nonNull;
+
+/**
+ * Collects settings that control the building of effective settings.
+ */
+@Experimental
+@Immutable
+public interface SettingsBuilderRequest
+{
+
+    @Nonnull
+    Session getSession();
+
+    /**
+     * Gets the global settings path.
+     *
+     * @return The global settings path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getGlobalSettingsPath();
+
+    /**
+     * Gets the global settings source.
+     *
+     * @return The global settings source or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Source> getGlobalSettingsSource();
+
+    /**
+     * Gets the user settings path.
+     *
+     * @return The user settings path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getUserSettingsPath();

Review Comment:
   Javadoc does not match code



##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/SettingsBuilderRequest.java:
##########
@@ -0,0 +1,204 @@
+package org.apache.maven.api.services;
+
+/*
+ * 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.
+ */
+
+import java.nio.file.Path;
+import java.util.Optional;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.annotations.Experimental;
+import org.apache.maven.api.annotations.Immutable;
+import org.apache.maven.api.annotations.Nonnull;
+import org.apache.maven.api.annotations.NotThreadSafe;
+import org.apache.maven.api.annotations.Nullable;
+
+import static org.apache.maven.api.services.BaseRequest.nonNull;
+
+/**
+ * Collects settings that control the building of effective settings.
+ */
+@Experimental
+@Immutable
+public interface SettingsBuilderRequest
+{
+
+    @Nonnull
+    Session getSession();
+
+    /**
+     * Gets the global settings path.
+     *
+     * @return The global settings path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getGlobalSettingsPath();
+
+    /**
+     * Gets the global settings source.
+     *
+     * @return The global settings source or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Source> getGlobalSettingsSource();
+
+    /**
+     * Gets the user settings path.
+     *
+     * @return The user settings path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getUserSettingsPath();
+
+    /**
+     * Gets the user settings source.
+     *
+     * @return The user settings source or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Source> getUserSettingsSource();
+
+    @Nonnull
+    static SettingsBuilderRequest build( @Nonnull Session session,
+                                         @Nonnull Source globalSettingsSource,
+                                         @Nonnull Source userSettingsSource )
+    {
+        return builder()
+                .session( nonNull( session, "session can not be null" ) )
+                .globalSettingsSource( nonNull( globalSettingsSource, "globalSettingsSource can not be null" ) )
+                .userSettingsSource( nonNull( userSettingsSource, "userSettingsSource can not be null" ) )
+                .build();
+    }
+
+    @Nonnull
+    static SettingsBuilderRequest build( @Nonnull Session session,
+                                         @Nonnull Path globalSettingsPath,
+                                         @Nonnull Path userSettingsPath )
+    {
+        return builder()
+                .session( nonNull( session, "session can not be null" ) )
+                .globalSettingsPath( nonNull( globalSettingsPath, "globalSettingsPath can not be null" ) )
+                .userSettingsPath( nonNull( userSettingsPath, "userSettingsPath can not be null" ) )
+                .build();
+    }

Review Comment:
   cannot



##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/ToolchainsBuilderRequest.java:
##########
@@ -0,0 +1,196 @@
+package org.apache.maven.api.services;
+
+/*
+ * 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.
+ */
+
+import java.nio.file.Path;
+import java.util.Optional;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.annotations.Nonnull;
+import org.apache.maven.api.annotations.NotThreadSafe;
+import org.apache.maven.api.annotations.Nullable;
+
+import static org.apache.maven.api.services.BaseRequest.nonNull;
+
+public interface ToolchainsBuilderRequest
+{
+    @Nonnull
+    Session getSession();
+
+    /**
+     * Gets the global Toolchains path.
+     *
+     * @return The global Toolchains path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getGlobalToolchainsPath();
+
+    /**
+     * Gets the global Toolchains source.
+     *
+     * @return The global Toolchains source or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Source> getGlobalToolchainsSource();
+
+    /**
+     * Gets the user Toolchains path.
+     *
+     * @return The user Toolchains path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getUserToolchainsPath();
+
+    /**
+     * Gets the user Toolchains source.
+     *
+     * @return The user Toolchains source or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Source> getUserToolchainsSource();

Review Comment:
   Javadoc does not match code



##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/ToolchainsBuilderRequest.java:
##########
@@ -0,0 +1,196 @@
+package org.apache.maven.api.services;
+
+/*
+ * 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.
+ */
+
+import java.nio.file.Path;
+import java.util.Optional;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.annotations.Nonnull;
+import org.apache.maven.api.annotations.NotThreadSafe;
+import org.apache.maven.api.annotations.Nullable;
+
+import static org.apache.maven.api.services.BaseRequest.nonNull;
+
+public interface ToolchainsBuilderRequest
+{
+    @Nonnull
+    Session getSession();
+
+    /**
+     * Gets the global Toolchains path.
+     *
+     * @return The global Toolchains path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getGlobalToolchainsPath();
+
+    /**
+     * Gets the global Toolchains source.
+     *
+     * @return The global Toolchains source or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Source> getGlobalToolchainsSource();

Review Comment:
   Javadoc does not match code



##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/ToolchainsBuilderRequest.java:
##########
@@ -0,0 +1,196 @@
+package org.apache.maven.api.services;
+
+/*
+ * 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.
+ */
+
+import java.nio.file.Path;
+import java.util.Optional;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.annotations.Nonnull;
+import org.apache.maven.api.annotations.NotThreadSafe;
+import org.apache.maven.api.annotations.Nullable;
+
+import static org.apache.maven.api.services.BaseRequest.nonNull;
+
+public interface ToolchainsBuilderRequest
+{
+    @Nonnull
+    Session getSession();
+
+    /**
+     * Gets the global Toolchains path.
+     *
+     * @return The global Toolchains path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getGlobalToolchainsPath();
+
+    /**
+     * Gets the global Toolchains source.
+     *
+     * @return The global Toolchains source or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Source> getGlobalToolchainsSource();
+
+    /**
+     * Gets the user Toolchains path.
+     *
+     * @return The user Toolchains path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getUserToolchainsPath();

Review Comment:
   Javadoc does not match code



##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/ToolchainsBuilderRequest.java:
##########
@@ -0,0 +1,196 @@
+package org.apache.maven.api.services;
+
+/*
+ * 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.
+ */
+
+import java.nio.file.Path;
+import java.util.Optional;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.annotations.Nonnull;
+import org.apache.maven.api.annotations.NotThreadSafe;
+import org.apache.maven.api.annotations.Nullable;
+
+import static org.apache.maven.api.services.BaseRequest.nonNull;
+
+public interface ToolchainsBuilderRequest
+{
+    @Nonnull
+    Session getSession();
+
+    /**
+     * Gets the global Toolchains path.
+     *
+     * @return The global Toolchains path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getGlobalToolchainsPath();
+
+    /**
+     * Gets the global Toolchains source.
+     *
+     * @return The global Toolchains source or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Source> getGlobalToolchainsSource();
+
+    /**
+     * Gets the user Toolchains path.
+     *
+     * @return The user Toolchains path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getUserToolchainsPath();
+
+    /**
+     * Gets the user Toolchains source.
+     *
+     * @return The user Toolchains source or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Source> getUserToolchainsSource();
+
+    @Nonnull
+    static ToolchainsBuilderRequest build( @Nonnull Session session,
+                                         @Nonnull Source globalToolchainsSource,
+                                         @Nonnull Source userToolchainsSource )
+    {
+        return builder()
+                .session( nonNull( session, "session can not be null" ) )
+                .globalToolchainsSource( nonNull( globalToolchainsSource, "globalToolchainsSource can not be null" ) )
+                .userToolchainsSource( nonNull( userToolchainsSource, "userToolchainsSource can not be null" ) )
+                .build();
+    }

Review Comment:
   cannot



##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/ToolchainsBuilderRequest.java:
##########
@@ -0,0 +1,196 @@
+package org.apache.maven.api.services;
+
+/*
+ * 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.
+ */
+
+import java.nio.file.Path;
+import java.util.Optional;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.annotations.Nonnull;
+import org.apache.maven.api.annotations.NotThreadSafe;
+import org.apache.maven.api.annotations.Nullable;
+
+import static org.apache.maven.api.services.BaseRequest.nonNull;
+
+public interface ToolchainsBuilderRequest
+{
+    @Nonnull
+    Session getSession();
+
+    /**
+     * Gets the global Toolchains path.
+     *
+     * @return The global Toolchains path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getGlobalToolchainsPath();

Review Comment:
   Javadoc does not match code



##########
maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectBuilder.java:
##########
@@ -228,9 +228,9 @@ public String getMessage()
                         }
 
                         @Override
-                        public ProjectBuilderProblemSeverity getSeverity()
+                        public BuilderProblemSeverity getSeverity()

Review Comment:
   Why isn't it `BuilderProblem.Severity`?



##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/ToolchainsBuilderRequest.java:
##########
@@ -0,0 +1,196 @@
+package org.apache.maven.api.services;
+
+/*
+ * 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.
+ */
+
+import java.nio.file.Path;
+import java.util.Optional;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.annotations.Nonnull;
+import org.apache.maven.api.annotations.NotThreadSafe;
+import org.apache.maven.api.annotations.Nullable;
+
+import static org.apache.maven.api.services.BaseRequest.nonNull;
+
+public interface ToolchainsBuilderRequest
+{
+    @Nonnull
+    Session getSession();
+
+    /**
+     * Gets the global Toolchains path.
+     *
+     * @return The global Toolchains path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getGlobalToolchainsPath();
+
+    /**
+     * Gets the global Toolchains source.
+     *
+     * @return The global Toolchains source or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Source> getGlobalToolchainsSource();
+
+    /**
+     * Gets the user Toolchains path.
+     *
+     * @return The user Toolchains path or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Path> getUserToolchainsPath();
+
+    /**
+     * Gets the user Toolchains source.
+     *
+     * @return The user Toolchains source or {@code null} if none.
+     */
+    @Nonnull
+    Optional<Source> getUserToolchainsSource();
+
+    @Nonnull
+    static ToolchainsBuilderRequest build( @Nonnull Session session,
+                                         @Nonnull Source globalToolchainsSource,
+                                         @Nonnull Source userToolchainsSource )
+    {
+        return builder()
+                .session( nonNull( session, "session can not be null" ) )
+                .globalToolchainsSource( nonNull( globalToolchainsSource, "globalToolchainsSource can not be null" ) )
+                .userToolchainsSource( nonNull( userToolchainsSource, "userToolchainsSource can not be null" ) )
+                .build();
+    }
+
+    @Nonnull
+    static ToolchainsBuilderRequest build( @Nonnull Session session,
+                                         @Nonnull Path globalToolchainsPath,
+                                         @Nonnull Path userToolchainsPath )
+    {
+        return builder()
+                .session( nonNull( session, "session can not be null" ) )
+                .globalToolchainsPath( nonNull( globalToolchainsPath, "globalToolchainsPath can not be null" ) )
+                .userToolchainsPath( nonNull( userToolchainsPath, "userToolchainsPath can not be null" ) )
+                .build();
+    }

Review Comment:
   cannot



##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/ToolchainsBuilderException.java:
##########
@@ -0,0 +1,43 @@
+package org.apache.maven.api.services;
+
+/*
+ * 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.
+ */
+
+import org.apache.maven.api.annotations.Experimental;
+
+/**
+ * The Exception class throw by the {@link ToolchainsBuilder}.
+ *
+ * @since 4.0
+ */
+@Experimental
+public class ToolchainsBuilderException
+    extends MavenException
+{
+    /**
+     * @param message The message to give.
+     * @param e The {@link Exception}.
+     */
+    public ToolchainsBuilderException( String message, Exception e )

Review Comment:
   Same here



-- 
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-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org