1 package org.apache.maven.plugins.shade;
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.plugins.shade.filter.Filter;
23 import org.apache.maven.plugins.shade.relocation.Relocator;
24 import org.apache.maven.plugins.shade.resource.ResourceTransformer;
25
26 import java.io.File;
27 import java.util.List;
28 import java.util.Set;
29
30 /**
31 * Parameter object used to pass multitude of args to Shader.shade()
32 * @since 2.0
33 */
34 public class ShadeRequest
35 {
36
37 private Set<File> jars;
38
39 private File uberJar;
40
41 private List<Filter> filters;
42
43 private List<Relocator> relocators;
44
45 private List<ResourceTransformer> resourceTransformers;
46
47 private boolean shadeSourcesContent;
48
49 public Set<File> getJars()
50 {
51 return jars;
52 }
53
54 /**
55 * Which jars to shade.
56 *
57 * @param jars The jars.
58 */
59 public void setJars( Set<File> jars )
60 {
61 this.jars = jars;
62 }
63
64 public File getUberJar()
65 {
66 return uberJar;
67 }
68
69 /**
70 * Output jar.
71 *
72 * @param uberJar The ueberJar file.
73 */
74 public void setUberJar( File uberJar )
75 {
76 this.uberJar = uberJar;
77 }
78
79 public List<Filter> getFilters()
80 {
81 return filters;
82 }
83
84 /**
85 * The filters.
86 *
87 * @param filters The filters
88 */
89 public void setFilters( List<Filter> filters )
90 {
91 this.filters = filters;
92 }
93
94 public List<Relocator> getRelocators()
95 {
96 return relocators;
97 }
98
99 /**
100 * The relocators.
101 *
102 * @param relocators The relocators.
103 */
104 public void setRelocators( List<Relocator> relocators )
105 {
106 this.relocators = relocators;
107 }
108
109 public List<ResourceTransformer> getResourceTransformers()
110 {
111 return resourceTransformers;
112 }
113
114 /**
115 * The transformers.
116 *
117 * @param resourceTransformers List of resourceTransformers.
118 */
119 public void setResourceTransformers( List<ResourceTransformer> resourceTransformers )
120 {
121 this.resourceTransformers = resourceTransformers;
122 }
123
124 public boolean isShadeSourcesContent()
125 {
126 return shadeSourcesContent;
127 }
128
129 /**
130 * When true, it will attempt to shade the contents of the java source files when creating the sources jar.
131 * When false, it will just relocate the java source files to the shaded paths, but will not modify the
132 * actual contents of the java source files.
133 *
134 * @param shadeSourcesContent {@code true} or {@code false}.
135 */
136 public void setShadeSourcesContent( boolean shadeSourcesContent )
137 {
138 this.shadeSourcesContent = shadeSourcesContent;
139 }
140 }