1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.internal.impl.resolver.type;
20
21 import java.util.Arrays;
22 import java.util.Collection;
23
24 import org.apache.maven.api.JavaPathType;
25 import org.apache.maven.api.Language;
26 import org.apache.maven.api.Type;
27 import org.apache.maven.api.di.Named;
28 import org.apache.maven.api.spi.TypeProvider;
29
30 @Named
31 public class DefaultTypeProvider implements TypeProvider {
32 @SuppressWarnings({"rawtypes", "unchecked"})
33 @Override
34 public Collection<Type> provides() {
35 return (Collection) types();
36 }
37
38 public Collection<DefaultType> types() {
39 return Arrays.asList(
40
41 new DefaultType(Type.POM, Language.NONE, "pom", null, false),
42 new DefaultType(Type.BOM, Language.NONE, "pom", null, false),
43 new DefaultType(Type.MAVEN_PLUGIN, Language.JAVA_FAMILY, "jar", null, false, JavaPathType.CLASSES),
44
45 new DefaultType(
46 Type.JAR, Language.JAVA_FAMILY, "jar", null, false, JavaPathType.CLASSES, JavaPathType.MODULES),
47 new DefaultType(Type.JAVADOC, Language.JAVA_FAMILY, "jar", "javadoc", false, JavaPathType.CLASSES),
48 new DefaultType(Type.JAVA_SOURCE, Language.JAVA_FAMILY, "jar", "sources", false),
49 new DefaultType(
50 Type.TEST_JAR,
51 Language.JAVA_FAMILY,
52 "jar",
53 "tests",
54 false,
55 JavaPathType.CLASSES,
56 JavaPathType.PATCH_MODULE),
57 new DefaultType(Type.MODULAR_JAR, Language.JAVA_FAMILY, "jar", null, false, JavaPathType.MODULES),
58 new DefaultType(Type.CLASSPATH_JAR, Language.JAVA_FAMILY, "jar", null, false, JavaPathType.CLASSES),
59
60 new DefaultType("ejb", Language.JAVA_FAMILY, "jar", null, false, JavaPathType.CLASSES),
61 new DefaultType("ejb-client", Language.JAVA_FAMILY, "jar", "client", false, JavaPathType.CLASSES),
62 new DefaultType("war", Language.JAVA_FAMILY, "war", null, true),
63 new DefaultType("ear", Language.JAVA_FAMILY, "ear", null, true),
64 new DefaultType("rar", Language.JAVA_FAMILY, "rar", null, true),
65 new DefaultType("par", Language.JAVA_FAMILY, "par", null, true));
66 }
67 }