1 package org.apache.maven.api; 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 */ 21 22 import org.apache.maven.api.annotations.Experimental; 23 import org.apache.maven.api.annotations.Immutable; 24 25 /** 26 * An artifact's{@code Type} represents a known kind of artifacts. 27 * Such types are often associated to an extension and possibly 28 * a classifier, for example {@code java-source} has a {@code jar} 29 * extension and a {@code sources} classifier. 30 * It is also used to determine if a given dependency should be 31 * included in the classpath or if its transitive dependencies should. 32 * 33 * @since 4.0 34 */ 35 @Experimental 36 @Immutable 37 public interface Type 38 { 39 40 String POM = "pom"; 41 String JAR = "jar"; 42 String JAVA_SOURCE = "java-source"; 43 String JAVADOC = "javadoc"; 44 String MAVEN_PLUGIN = "maven-plugin"; 45 String TEST_JAR = "test-jar"; 46 47 /** 48 * Returns the dependency type name. 49 * 50 * @return the type name 51 */ 52 String getName(); 53 54 /** 55 * Get the file extension associated to the file represented by the dependency type. 56 * 57 * @return the file extension 58 */ 59 String getExtension(); 60 61 /** 62 * Get the classifier associated to the dependency type. 63 * 64 * @return the classifier 65 */ 66 String getClassifier(); 67 68 boolean isIncludesDependencies(); 69 70 boolean isAddedToClasspath(); 71 72 }