Skip to content

Commit

Permalink
[MNG-8084] Move ModelBuilder and resolver provider to v4 api
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Mar 27, 2024
1 parent a5ea944 commit 3972cf3
Show file tree
Hide file tree
Showing 141 changed files with 17,274 additions and 722 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* 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.List;

import org.apache.maven.api.Service;

public interface ModelBuilder extends Service {

List<String> VALID_MODEL_VERSIONS = List.of("4.0.0", "4.1.0");

ModelBuilderResult build(ModelBuilderRequest request) throws ModelBuilderException;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* 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 org.apache.maven.api.annotations.Experimental;

/**
* The Exception class throw by the {@link ProjectBuilder} service.
*
* @since 4.0.0
*/
@Experimental
public class ModelBuilderException extends MavenException {

private final ModelBuilderResult result;

/**
* Creates a new exception from the specified interim result and its associated problems.
*
* @param result The interim result, may be {@code null}.
*/
public ModelBuilderException(ModelBuilderResult result) {
super(result.toString());
this.result = result;
}

/**
* Gets the interim result of the model building up to the point where it failed.
*
* @return The interim model building result or {@code null} if not available.
*/
public ModelBuilderResult getResult() {
return result;
}
}

0 comments on commit 3972cf3

Please sign in to comment.