You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2017/12/20 09:33:36 UTC
[maven-ear-plugin] 19/45: PR: MNG-822 Submitted by: Edwin Punzalan
Reviewed by: Brett Porter EAR improvements
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ear-plugin-2.0
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git
commit 9c875805967bd1f05213dfa57715b74d8f46f4aa
Author: Brett Leslie Porter <br...@apache.org>
AuthorDate: Sat Sep 3 07:34:07 2005 +0000
PR: MNG-822
Submitted by: Edwin Punzalan
Reviewed by: Brett Porter
EAR improvements
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk/maven-plugins/maven-ear-plugin@267433 13f79535-47bb-0310-9956-ffa450edef68
---
.../java/org/apache/maven/plugin/ear/EarMojo.java | 37 +++++++++++++++++-----
1 file changed, 29 insertions(+), 8 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugin/ear/EarMojo.java b/src/main/java/org/apache/maven/plugin/ear/EarMojo.java
index d52a6dc..c215715 100644
--- a/src/main/java/org/apache/maven/plugin/ear/EarMojo.java
+++ b/src/main/java/org/apache/maven/plugin/ear/EarMojo.java
@@ -51,14 +51,14 @@ public class EarMojo
*
* @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 @@ public class EarMojo
* @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 @@ public class EarMojo
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 @@ public class EarMojo
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 @@ public class EarMojo
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 stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.