- Jar dependencies are not included in the generated application.xml ; Hence 'library' is the default behavior and has been removed
- Added includeInApplicationXml property on JavaModule to allow it to be included in the generated application.xml

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@279376 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephane Nicoll 2005-09-07 16:37:45 +00:00
parent 8f02461a69
commit 9da3f0d5ff
2 changed files with 14 additions and 25 deletions

View File

@ -30,7 +30,7 @@ public class JavaModule
{ {
protected static final String JAVA_MODULE = "java"; protected static final String JAVA_MODULE = "java";
private Boolean library = Boolean.FALSE; private Boolean includeInApplicationXml = Boolean.FALSE;
public JavaModule() public JavaModule()
{ {
@ -43,9 +43,10 @@ public class JavaModule
public void appendModule( XMLWriter writer, String version ) public void appendModule( XMLWriter writer, String version )
{ {
// Generates an entry in the application.xml only if this // Generates an entry in the application.xml only if
// module is not a library // includeInApplicationXml is set
if (!isLibrary()) { if ( includeInApplicationXml.booleanValue() )
{
writer.startElement( MODULE_ELEMENT ); writer.startElement( MODULE_ELEMENT );
writer.startElement( JAVA_MODULE ); writer.startElement( JAVA_MODULE );
writer.writeText( getUri() ); writer.writeText( getUri() );
@ -58,17 +59,4 @@ public class JavaModule
{ {
return "jar"; return "jar";
} }
/**
* Specify whether this Java module is a third party library or not.
* <p/>
* If <tt>true</tt>, the module will not be included in the generated
* <tt>application.xml</tt>.
*
* @return true if the module is a third party library, false otherwise
*/
public boolean isLibrary()
{
return library.booleanValue();
}
} }

View File

@ -3,7 +3,7 @@
--- ---
Stéphane Nicoll Stéphane Nicoll
--- ---
15-Aug-2005 07-Sep-2005
--- ---
Introduction Introduction
@ -25,8 +25,10 @@ Introduction
Also, a dependency might be excluded from the generated EAR file by specifying the Also, a dependency might be excluded from the generated EAR file by specifying the
excluded flag. excluded flag.
Finally, third party libraries are handled by setting the library flag. If this flag Please note that third party libraries are not included in the generated
is set, the module is not included in the generated application.xml application.xml (only ejb-client should be included in a <java> entry). However, a
jar dependency could be included in the generated application.xml by specifying the
includeInApplicationXml flag.
Customizing the context root Customizing the context root
@ -157,11 +159,10 @@ Excluding a module
</build> </build>
+--------- +---------
Declaring a module as a third party library Including a third party library in the generated application.xml
If third party libraries need to be included in an EAR file, the 'library' flag could be If third party libraries need to be included in the generated application.xml, the
used. Note that no entry in the application.xml will be created for such module. This 'includeInApplicationXml' flag could be used. This flag works only for java modules.
flag works only for java modules.
+-------- +--------
<build> <build>
@ -175,7 +176,7 @@ Declaring a module as a third party library
<javaModule> <javaModule>
<groupId>artifactGroupId</groupId> <groupId>artifactGroupId</groupId>
<artifactId>artifactId</artifactId> <artifactId>artifactId</artifactId>
<library>true</library> <includeInApplicationXml>true</includeInApplicationXml>
</javaModule> </javaModule>
</modules> </modules>
</configuration> </configuration>