1 package org.apache.maven.project.overlay; 2 3 18 19 import org.apache.maven.model.Build; 20 import org.apache.maven.model.Extension; 21 import org.apache.maven.model.Plugin; 22 import org.apache.maven.model.PluginManagement; 23 import org.apache.maven.model.Resource; 24 25 import java.util.ArrayList ; 26 import java.util.List ; 27 import java.util.Map ; 28 29 32 public class BuildOverlay 33 extends Build 34 { 35 36 private final Build build; 37 38 private List resources; 39 private List testResources; 40 41 public BuildOverlay( Build build ) 42 { 43 if ( build == null ) 44 { 45 this.build = new Build(); 46 47 this.resources = new ArrayList (); 48 49 this.testResources = new ArrayList (); 50 } 51 else 52 { 53 this.build = build; 54 55 this.resources = new ArrayList ( build.getResources() ); 56 57 this.testResources = new ArrayList ( build.getTestResources() ); 58 } 59 } 60 61 public void addExtension( Extension extension ) 62 { 63 build.addExtension( extension ); 64 } 65 66 public void addPlugin( Plugin plugin ) 67 { 68 build.addPlugin( plugin ); 69 } 70 71 public void addResource( Resource resource ) 72 { 73 resources.add( resource ); 74 } 75 76 public void addTestResource( Resource resource ) 77 { 78 testResources.add( resource ); 79 } 80 81 public boolean equals( Object obj ) 82 { 83 return build.equals( obj ); 84 } 85 86 public void flushPluginMap() 87 { 88 build.flushPluginMap(); 89 } 90 91 public String getDefaultGoal() 92 { 93 return build.getDefaultGoal(); 94 } 95 96 public String getDirectory() 97 { 98 return build.getDirectory(); 99 } 100 101 public List getExtensions() 102 { 103 return build.getExtensions(); 104 } 105 106 public String getFinalName() 107 { 108 return build.getFinalName(); 109 } 110 111 public String getOutputDirectory() 112 { 113 return build.getOutputDirectory(); 114 } 115 116 public PluginManagement getPluginManagement() 117 { 118 return build.getPluginManagement(); 119 } 120 121 public List getPlugins() 122 { 123 return build.getPlugins(); 124 } 125 126 public Map getPluginsAsMap() 127 { 128 return build.getPluginsAsMap(); 129 } 130 131 public List getResources() 132 { 133 return resources; 134 } 135 136 public String getScriptSourceDirectory() 137 { 138 return build.getScriptSourceDirectory(); 139 } 140 141 public String getSourceDirectory() 142 { 143 return build.getSourceDirectory(); 144 } 145 146 public String getTestOutputDirectory() 147 { 148 return build.getTestOutputDirectory(); 149 } 150 151 public List getTestResources() 152 { 153 return testResources; 154 } 155 156 public String getTestSourceDirectory() 157 { 158 return build.getTestSourceDirectory(); 159 } 160 161 public int hashCode() 162 { 163 return build.hashCode(); 164 } 165 166 public void removeExtension( Extension extension ) 167 { 168 build.removeExtension( extension ); 169 } 170 171 public void removePlugin( Plugin plugin ) 172 { 173 build.removePlugin( plugin ); 174 } 175 176 public void removeResource( Resource resource ) 177 { 178 resources.remove( resource ); 179 } 180 181 public void removeTestResource( Resource resource ) 182 { 183 testResources.remove( resource ); 184 } 185 186 public void setDefaultGoal( String defaultGoal ) 187 { 188 build.setDefaultGoal( defaultGoal ); 189 } 190 191 public void setDirectory( String directory ) 192 { 193 build.setDirectory( directory ); 194 } 195 196 public void setExtensions( List extensions ) 197 { 198 build.setExtensions( extensions ); 199 } 200 201 public void setFinalName( String finalName ) 202 { 203 build.setFinalName( finalName ); 204 } 205 206 public void setOutputDirectory( String outputDirectory ) 207 { 208 build.setOutputDirectory( outputDirectory ); 209 } 210 211 public void setPluginManagement( PluginManagement pluginManagement ) 212 { 213 build.setPluginManagement( pluginManagement ); 214 } 215 216 public void setPlugins( List plugins ) 217 { 218 build.setPlugins( plugins ); 219 } 220 221 public void setResources( List resources ) 222 { 223 this.resources = resources; 224 } 225 226 public void setScriptSourceDirectory( String scriptSourceDirectory ) 227 { 228 build.setScriptSourceDirectory( scriptSourceDirectory ); 229 } 230 231 public void setSourceDirectory( String sourceDirectory ) 232 { 233 build.setSourceDirectory( sourceDirectory ); 234 } 235 236 public void setTestOutputDirectory( String testOutputDirectory ) 237 { 238 build.setTestOutputDirectory( testOutputDirectory ); 239 } 240 241 public void setTestResources( List testResources ) 242 { 243 this.testResources = testResources; 244 } 245 246 public void setTestSourceDirectory( String testSourceDirectory ) 247 { 248 build.setTestSourceDirectory( testSourceDirectory ); 249 } 250 251 public String toString() 252 { 253 return build.toString(); 254 } 255 256 public void addFilter( String string ) 257 { 258 build.addFilter( string ); 259 } 261 public List getFilters() 262 { 263 return build.getFilters(); 264 } 266 public void removeFilter( String string ) 267 { 268 build.removeFilter( string ); 269 } 271 public void setFilters( List filters ) 272 { 273 build.setFilters( filters ); 274 } } 276 | Popular Tags |