View Javadoc
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.api;
20  
21  import org.apache.maven.api.annotations.Experimental;
22  import org.apache.maven.api.annotations.Immutable;
23  
24  /**
25   * An artifact's{@code Type} represents a known kind of artifacts.
26   * Such types are often associated to an extension and possibly
27   * a classifier, for example {@code java-source} has a {@code jar}
28   * extension and a {@code sources} classifier.
29   * It is also used to determine if a given dependency should be
30   * included in the classpath or if its transitive dependencies should.
31   *
32   * @since 4.0
33   */
34  @Experimental
35  @Immutable
36  public interface Type {
37  
38      String POM = "pom";
39      String JAR = "jar";
40      String JAVA_SOURCE = "java-source";
41      String JAVADOC = "javadoc";
42      String MAVEN_PLUGIN = "maven-plugin";
43      String TEST_JAR = "test-jar";
44  
45      /**
46       * Returns the dependency type name.
47       *
48       * @return the type name
49       */
50      String getName();
51  
52      /**
53       * Get the file extension associated to the file represented by the dependency type.
54       *
55       * @return the file extension
56       */
57      String getExtension();
58  
59      /**
60       * Get the classifier associated to the dependency type.
61       *
62       * @return the classifier
63       */
64      String getClassifier();
65  
66      boolean isIncludesDependencies();
67  
68      boolean isAddedToClasspath();
69  }