You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by br...@apache.org on 2005/09/03 09:34:11 UTC
svn commit: r267433 -
/maven/components/trunk/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java
Author: brett
Date: Sat Sep 3 00:34:07 2005
New Revision: 267433
URL: http://svn.apache.org/viewcvs?rev=267433&view=rev
Log:
PR: MNG-822
Submitted by: Edwin Punzalan
Reviewed by: Brett Porter
EAR improvements
Modified:
maven/components/trunk/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java
Modified: maven/components/trunk/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java?rev=267433&r1=267432&r2=267433&view=diff
==============================================================================
--- maven/components/trunk/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java (original)
+++ maven/components/trunk/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java Sat Sep 3 00:34:07 2005
@@ -51,14 +51,14 @@
*
* @parameter expression="${basedir}/src/main/application/META-INF/MANIFEST.MF"
*/
- private String manifestLocation;
+ private String manifestFile;
/**
* The location of the application.xml file to be used within the ear file.
*
* @parameter expression="${basedir}/src/main/application/META-INF/application.xml"
*/
- private String applicationXmlLocation;
+ private String applicationXmlFile;
/**
* The directory for the generated EAR.
@@ -76,7 +76,14 @@
* @readonly
*/
private String finalName;
-
+
+ /**
+ * Directory that resources are copied to during the build.
+ *
+ * @parameter expression="${project.build.directory}/ear"
+ */
+ private File resourcesDir;
+
/**
* The maven archiver to use.
*
@@ -93,8 +100,8 @@
getLog().debug( " ======= EarMojo settings =======" );
getLog().debug( "earSourceDirectory[" + earSourceDirectory + "]" );
- getLog().debug( "manifestLocation[" + manifestLocation + "]" );
- getLog().debug( "applicationXmlLocation[" + applicationXmlLocation + "]" );
+ getLog().debug( "manifestLocation[" + manifestFile + "]" );
+ getLog().debug( "applicationXmlLocation[" + applicationXmlFile + "]" );
getLog().debug( "workDirectory[" + getWorkDirectory() + "]" );
getLog().debug( "outputDirectory[" + outputDirectory + "]" );
getLog().debug( "finalName[" + finalName + "]" );
@@ -130,12 +137,26 @@
File earSourceDir = new File( earSourceDirectory );
if ( earSourceDir.exists() )
{
- getLog().info( "Copy ear resources to " + getBuildDir().getAbsolutePath() );
+ getLog().info( "Copy ear sources to " + getBuildDir().getAbsolutePath() );
FileUtils.copyDirectoryStructure( earSourceDir, getBuildDir() );
}
}
catch ( IOException e )
{
+ throw new MojoExecutionException( "Error copying EAR sources", e );
+ }
+
+ // Copy resources files
+ try
+ {
+ if ( resourcesDir.exists() )
+ {
+ getLog().info( "Copy ear resources to " + getBuildDir().getAbsolutePath() );
+ FileUtils.copyDirectoryStructure( resourcesDir, getBuildDir() );
+ }
+ }
+ catch ( IOException e )
+ {
throw new MojoExecutionException( "Error copying EAR resources", e );
}
@@ -174,10 +195,10 @@
private void includeCustomManifestFile()
{
- File customManifestFile = new File( manifestLocation );
+ File customManifestFile = new File( manifestFile );
if ( !customManifestFile.exists() )
{
- // Does not exist so will use default
+ getLog().info( "Could not find manifest file: " + manifestFile );
}
else
{
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org