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/10/03 04:30:17 UTC
svn commit: r293212 - in /maven/components/trunk:
maven-core/src/main/resources/META-INF/plexus/
maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/
maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resour...
Author: brett
Date: Sun Oct 2 19:30:06 2005
New Revision: 293212
URL: http://svn.apache.org/viewcvs?rev=293212&view=rev
Log:
PR: MNG-1025
use standard resources for the ear plugin
Modified:
maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml
maven/components/trunk/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
maven/components/trunk/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java
maven/components/trunk/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/GenerateApplicationXmlMojo.java
maven/components/trunk/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java
Modified: maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml?rev=293212&r1=293211&r2=293212&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml Sun Oct 2 19:30:06 2005
@@ -330,6 +330,7 @@
<!-- START SNIPPET: ear-lifecycle -->
<phases>
<generate-resources>org.apache.maven.plugins:maven-ear-plugin:generate-application-xml</generate-resources>
+ <process-resources>org.apache.maven.plugins:maven-resources-plugin:resources</process-resources>
<package>org.apache.maven.plugins:maven-ear-plugin:ear</package>
<install>org.apache.maven.plugins:maven-install-plugin:install</install>
<deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
@@ -350,10 +351,7 @@
<process-test-resources>org.apache.maven.plugins:maven-resources-plugin:testResources</process-test-resources>
<test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
<test>org.apache.maven.plugins:maven-surefire-plugin:test</test>
- <package>
- org.apache.maven.plugins:maven-jar-plugin:jar,
- org.apache.maven.plugins:maven-rar-plugin:rar
- </package>
+ <package>org.apache.maven.plugins:maven-rar-plugin:rar</package>
<install>org.apache.maven.plugins:maven-install-plugin:install</install>
<deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
</phases>
Modified: maven/components/trunk/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java?rev=293212&r1=293211&r2=293212&view=diff
==============================================================================
--- maven/components/trunk/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java (original)
+++ maven/components/trunk/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java Sun Oct 2 19:30:06 2005
@@ -61,14 +61,12 @@
* @parameter expression="${project.build.directory}/${project.build.finalName}"
* @required
*/
- private String workDirectory;
+ private File workDirectory;
private List earModules;
private List allModules;
- private File buildDir;
-
public void execute()
throws MojoExecutionException
{
@@ -138,21 +136,12 @@
return earModules;
}
- protected File getBuildDir()
- {
- if ( buildDir == null )
- {
- buildDir = new File( workDirectory );
- }
- return buildDir;
- }
-
protected MavenProject getProject()
{
return project;
}
- protected String getWorkDirectory()
+ protected File getWorkDirectory()
{
return workDirectory;
}
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=293212&r1=293211&r2=293212&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 Sun Oct 2 19:30:06 2005
@@ -76,14 +76,15 @@
* @readonly
*/
private String finalName;
-
+
/**
- * Directory that resources are copied to during the build.
+ * The directory to get the resources from.
*
- * @parameter expression="${project.build.directory}/ear"
+ * @parameter expression="${project.build.outputDirectory}"
+ * @required
*/
private File resourcesDir;
-
+
/**
* The maven archiver to use.
*
@@ -113,7 +114,7 @@
{
EarModule module = (EarModule) iter.next();
getLog().info( "Copying artifact[" + module + "] to[" + module.getUri() + "]" );
- File destinationFile = buildDestinationFile( getBuildDir(), module.getUri() );
+ File destinationFile = buildDestinationFile( getWorkDirectory(), module.getUri() );
File sourceFile = module.getArtifact().getFile();
@@ -137,8 +138,8 @@
File earSourceDir = new File( earSourceDirectory );
if ( earSourceDir.exists() )
{
- getLog().info( "Copy ear sources to " + getBuildDir().getAbsolutePath() );
- FileUtils.copyDirectoryStructure( earSourceDir, getBuildDir() );
+ getLog().info( "Copy ear sources to " + getWorkDirectory().getAbsolutePath() );
+ FileUtils.copyDirectoryStructure( earSourceDir, getWorkDirectory() );
}
}
catch ( IOException e )
@@ -151,8 +152,8 @@
{
if ( resourcesDir.exists() )
{
- getLog().info( "Copy ear resources to " + getBuildDir().getAbsolutePath() );
- FileUtils.copyDirectoryStructure( resourcesDir, getBuildDir() );
+ getLog().info( "Copy ear resources to " + getWorkDirectory().getAbsolutePath() );
+ FileUtils.copyDirectoryStructure( resourcesDir, getWorkDirectory() );
}
}
catch ( IOException e )
@@ -161,7 +162,7 @@
}
// Check if deployment descriptor is there
- File ddFile = new File( getBuildDir(), APPLICATION_XML_URI );
+ File ddFile = new File( getWorkDirectory(), APPLICATION_XML_URI );
if ( !ddFile.exists() )
{
throw new MojoExecutionException(
@@ -177,7 +178,7 @@
// Include custom manifest if necessary
includeCustomManifestFile();
- archiver.getArchiver().addDirectory( getBuildDir() );
+ archiver.getArchiver().addDirectory( getWorkDirectory() );
archiver.createArchive( getProject(), archive );
project.getArtifact().setFile( earFile );
@@ -198,7 +199,7 @@
File customManifestFile = new File( manifestFile );
if ( !customManifestFile.exists() )
{
- getLog().info( "Could not find manifest file: " + manifestFile +" - Generating one");
+ getLog().info( "Could not find manifest file: " + manifestFile + " - Generating one" );
}
else
{
Modified: maven/components/trunk/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/GenerateApplicationXmlMojo.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/GenerateApplicationXmlMojo.java?rev=293212&r1=293211&r2=293212&view=diff
==============================================================================
--- maven/components/trunk/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/GenerateApplicationXmlMojo.java (original)
+++ maven/components/trunk/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/GenerateApplicationXmlMojo.java Sun Oct 2 19:30:06 2005
@@ -120,7 +120,7 @@
getLog().info( "Generating application.xml" );
generateDeploymentDescriptor();
FileUtils.copyFileToDirectory( new File( generatedDescriptorLocation, "application.xml" ),
- new File( getBuildDir(), "META-INF" ) );
+ new File( getWorkDirectory(), "META-INF" ) );
}
catch ( IOException e )
{
Modified: maven/components/trunk/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java?rev=293212&r1=293211&r2=293212&view=diff
==============================================================================
--- maven/components/trunk/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java (original)
+++ maven/components/trunk/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java Sun Oct 2 19:30:06 2005
@@ -38,13 +38,14 @@
import java.util.Properties;
/**
+ * Copy application resources.
+ *
* @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @author Andreas Hoheneder
* @version $Id$
* @goal resources
* @phase process-resources
- * @description copy application resources
*/
public class ResourcesMojo
extends AbstractMojo
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org