1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.apache.maven.model.building;
20
21 import java.net.URI;
22
23 /**
24 * Provides access to the contents of a POM independently of the backing store (e.g. file system, database, memory).
25 * <p>
26 * Unlike {@link ModelSource}, this interface supports loading of parent POM(s) from the same backing store and allows
27 * construction of MavenProject instances without the need to have parent POM(s) available from local or remote
28 * repositories.
29 * <p>
30 * ModelSource2 instances are cached in {@link ModelBuildingRequest#getModelCache()}. Implementations must guarantee
31 * that the connection to the backing store remains active until request's {@link ModelCache} is discarded or flushed.
32 *
33 * @deprecated use {@link org.apache.maven.api.services.ModelBuilder} instead
34 */
35 @Deprecated(since = "4.0.0")
36 public interface ModelSource2 extends ModelSource {
37 /**
38 * Returns model source identified by a path relative to this model source POM. Implementation <strong>MUST</strong>
39 * be able to accept <code>relPath</code> parameter values that
40 * <ul>
41 * <li>use either / or \ file path separator</li>
42 * <li>have .. parent directory references</li>
43 * <li>point either at file or directory, in the latter case POM file name 'pom.xml' needs to be used by the
44 * requested model source.</li>
45 * </ul>
46 *
47 * @param relPath is the path of the requested model source relative to this model source POM.
48 * @return related model source or <code>null</code> if no such model source.
49 */
50 ModelSource2 getRelatedSource(String relPath);
51
52 /**
53 * Returns location of the POM, never <code>null</code>.
54 */
55 URI getLocationURI();
56 }