1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.repository.internal.type;
20
21 import javax.inject.Named;
22
23 import java.util.Arrays;
24 import java.util.Collection;
25
26 import org.apache.maven.api.JavaPathType;
27 import org.apache.maven.api.Language;
28 import org.apache.maven.api.Type;
29 import org.apache.maven.api.spi.TypeProvider;
30
31 @Named
32 public class DefaultTypeProvider implements TypeProvider {
33 @SuppressWarnings({"rawtypes", "unchecked"})
34 @Override
35 public Collection<Type> provides() {
36 return (Collection) types();
37 }
38
39 public Collection<DefaultType> types() {
40 return Arrays.asList(
41
42 new DefaultType(Type.POM, Language.NONE, "pom", null, false),
43 new DefaultType(Type.BOM, Language.NONE, "pom", null, false),
44 new DefaultType(Type.MAVEN_PLUGIN, Language.JAVA_FAMILY, "jar", null, false, JavaPathType.CLASSES),
45
46 new DefaultType(
47 Type.JAR, Language.JAVA_FAMILY, "jar", null, false, JavaPathType.CLASSES, JavaPathType.MODULES),
48 new DefaultType(Type.JAVADOC, Language.JAVA_FAMILY, "jar", "javadoc", false, JavaPathType.CLASSES),
49 new DefaultType(Type.JAVA_SOURCE, Language.JAVA_FAMILY, "jar", "sources", false),
50 new DefaultType(
51 Type.TEST_JAR,
52 Language.JAVA_FAMILY,
53 "jar",
54 "tests",
55 false,
56 JavaPathType.CLASSES,
57 JavaPathType.PATCH_MODULE),
58 new DefaultType(Type.MODULAR_JAR, Language.JAVA_FAMILY, "jar", null, false, JavaPathType.MODULES),
59 new DefaultType(Type.CLASSPATH_JAR, Language.JAVA_FAMILY, "jar", null, false, JavaPathType.CLASSES),
60 new DefaultType(Type.FATJAR, Language.JAVA_FAMILY, "jar", null, true, JavaPathType.CLASSES),
61 new DefaultType(
62 Type.PROCESSOR,
63 Language.JAVA_FAMILY,
64 "jar",
65 null,
66 false,
67 JavaPathType.PROCESSOR_CLASSES,
68 JavaPathType.PROCESSOR_MODULES),
69 new DefaultType(
70 Type.MODULAR_PROCESSOR,
71 Language.JAVA_FAMILY,
72 "jar",
73 null,
74 false,
75 JavaPathType.PROCESSOR_MODULES),
76 new DefaultType(
77 Type.CLASSPATH_PROCESSOR,
78 Language.JAVA_FAMILY,
79 "jar",
80 null,
81 false,
82 JavaPathType.PROCESSOR_CLASSES),
83
84 new DefaultType("ejb", Language.JAVA_FAMILY, "jar", null, false, JavaPathType.CLASSES),
85 new DefaultType("ejb-client", Language.JAVA_FAMILY, "jar", "client", false, JavaPathType.CLASSES),
86 new DefaultType("war", Language.JAVA_FAMILY, "war", null, true),
87 new DefaultType("ear", Language.JAVA_FAMILY, "ear", null, true),
88 new DefaultType("rar", Language.JAVA_FAMILY, "rar", null, true),
89 new DefaultType("par", Language.JAVA_FAMILY, "par", null, true));
90 }
91 }