View Javadoc

1   package org.alfresco.maven.plugin.amp.packaging;
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.archiver.MavenArchiveConfiguration;
23  import org.apache.maven.plugin.MojoExecutionException;
24  import org.apache.maven.plugin.logging.Log;
25  import org.alfresco.maven.plugin.amp.util.AmpStructure;
26  import org.apache.maven.project.MavenProject;
27  import org.codehaus.plexus.archiver.jar.JarArchiver;
28  import org.codehaus.plexus.archiver.manager.ArchiverManager;
29  
30  import java.io.File;
31  import java.util.List;
32  import java.util.Map;
33  
34  /***
35   * The packaging context  of the AMP
36   *
37   * @author Stephane Nicoll - Modified version for AMP
38   * 
39   */
40  public interface AmpPackagingContext
41  {
42      /***
43       * Returns the maven project.
44       *
45       * @return the project
46       */
47      MavenProject getProject();
48  
49      /***
50       * Returns the webapp directory. Packaging tasks should use this
51       * directory to generate the webapp.
52       *
53       * @return the webapp directory
54       */
55      File getAmpDirectory();
56  
57       /***
58       * Returns the AMP classes + resources folder 
59       *
60       * @return the webapp source directory
61       */
62      File getAmpConfigDirectory();
63  
64      
65      /***
66       * Returns the AMP web directory.
67       *
68       * @return the webapp source directory
69       */
70      File getAmpWebDirectory();
71  
72      /***
73       * Returns the webapp source includes.
74       *
75       * @return the webapp source includes
76       */
77      String[] getAmpJarIncludes();
78  
79      /***
80       * Returns the webapp source excludes.
81       *
82       * @return the webapp source excludes
83       */
84      String[] getAmpJarExcludes();
85  
86      
87      /***
88       * Returns the AMP web/ includes.
89       *
90       * @return the AMP web/ includes
91       */
92      String[] getAmpWebIncludes();
93      
94      /***
95       * Returns the AMP web/ excludes.
96       *
97       * @return the AMP web/ excludes
98       */
99      String[] getAmpWebExcludes();
100     
101     
102     /***
103      * Returns the directory holding generated classes to be packed in the jar - By default is the same of the AMP configuration
104      *
105      * @return the classes directory
106      */
107     File getClassesDirectory();
108 
109 
110     /***
111      * Returns the logger to use to output logging event.
112      *
113      * @return the logger
114      */
115     Log getLog();
116 
117     /***
118      * Returns the directory to unpack dependent WARs into if needed.
119      *
120      * @return the overlays work directory
121      */
122     File getOverlaysWorkDirectory();
123 
124     /***
125      * Returns the archiver manager to use.
126      *
127      * @return the archiver manager
128      */
129     ArchiverManager getArchiverManager();
130 
131     /***
132      * The maven archive configuration to use.
133      *
134      * @return the maven archive configuration
135      */
136     MavenArchiveConfiguration getArchive();
137 
138     /***
139      * Returns the Jar archiver needed for archiving classes directory into
140      * jar file under WEB-INF/lib.
141      *
142      * @return the jar archiver to user
143      */
144     JarArchiver getJarArchiver();
145 
146     /***
147      * Returns the output file name mapping to use, if any. Returns <tt>null</tt>
148      * if no file name mapping is set.
149      *
150      * @return the output file name mapping or <tt>null</tt>
151      */
152     String getOutputFileNameMapping();
153 
154     /***
155      * Returns the list of filter files to use.
156      *
157      * @return a list of filter files
158      */
159     List getFilters();
160 
161     /***
162      * Returns the filter properties to use to filter resources.
163      * <p/>
164      * TODO: this needs to be refactored to use the resource plugin somehow.
165      *
166      * @return a map of filter properties
167      * @throws MojoExecutionException if an error occured while reading a filter file
168      */
169     Map getFilterProperties()
170         throws MojoExecutionException;
171 
172     /***
173      * Returns the {@link AmpStructure}.
174      *
175      * @return the webapp structure
176      */
177     AmpStructure getAmpStructure();
178 
179     /***
180      * Returns the list of registered overlays for this session. This list might
181      * differ from the one returned by the cache; in this case, it means that the
182      * project's configuration has changed. The plugin will handle thos cases nicely
183      * but it would be better in general to invoke the clean goal.
184      *
185      * @return the list of registered overlays, including the current project
186      */
187     List getOwnerIds();
188 
189 }