1 package org.apache.maven.plugin.ear;
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.artifact.Artifact;
23 import org.apache.maven.plugin.MojoFailureException;
24 import org.codehaus.plexus.util.xml.XMLWriter;
25
26 import java.util.Set;
27
28 /**
29 * The ear module interface.
30 *
31 * @author <a href="snicoll@apache.org">Stephane Nicoll</a>
32 * @version $Id: EarModule.java 992817 2010-09-05 16:32:58Z snicoll $
33 */
34 public interface EarModule
35 {
36
37 /**
38 * Returns the {@link Artifact} representing this module.
39 * <p/>
40 * Note that this might return <tt>null</tt> till the
41 * module has been resolved.
42 *
43 * @return the artifact
44 * @see #resolveArtifact(java.util.Set)
45 */
46 public Artifact getArtifact();
47
48 /**
49 * Returns the <tt>URI</tt> for this module.
50 *
51 * @return the <tt>URI</tt>
52 */
53 public String getUri();
54
55 /**
56 * Returns the type associated to the module.
57 *
58 * @return the artifact's type of the module
59 */
60 public String getType();
61
62 /**
63 * Specify whether this module should be excluded or not.
64 *
65 * @return true if this module should be skipped, false otherwise
66 */
67 public boolean isExcluded();
68
69 /**
70 * Specify whether this module should be unpacked in the
71 * EAR archive or not.
72 * <p/>
73 * Returns null if no configuration was specified so that
74 * defaulting may apply.
75 *
76 * @return true if this module should be bundled unpacked, false otherwise
77 */
78 public Boolean shouldUnpack();
79
80 /**
81 * The alt-dd element specifies an optional URI to the post-assembly version
82 * of the deployment descriptor file for a particular Java EE module. The URI
83 * must specify the full pathname of the deployment descriptor file relative
84 * to the application's root directory.
85 *
86 * @return the alternative deployment descriptor for this module
87 * @since JavaEE 5
88 */
89 public String getAltDeploymentDescriptor();
90
91 /**
92 * Appends the <tt>XML</tt> representation of this module.
93 *
94 * @param writer the writer to use
95 * @param version the version of the <tt>application.xml</tt> file
96 * @param generateId whether an id should be generated
97 */
98 public void appendModule( XMLWriter writer, String version, Boolean generateId );
99
100 /**
101 * Resolves the {@link Artifact} represented by the module. Note
102 * that the {@link EarExecutionContext} might be used to customiz
103 * further the resolution.
104 *
105 * @param artifacts the project's artifacts
106 * @throws EarPluginException if the artifact could not be resolved
107 * @throws MojoFailureException if an unexpected error occured
108 */
109 public void resolveArtifact( Set artifacts )
110 throws EarPluginException, MojoFailureException;
111
112 public void setEarExecutionContext( EarExecutionContext earExecutionContext );
113
114 }