Author: jtolentino
Date: Sun Nov 5 10:22:37 2006
New Revision: 471487
URL: http://svn.apache.org/viewvc?view=rev&rev=471487
Log:
[MWAR-59] Resolution of ejb artifact final name. Now uses "-client" when
artifact type is "ejb-client". Fix and test case modification submitted by
Andreas Wuest.
Modified:
maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java
maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoTest.java
Modified:
maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java?view=diff&rev=471487&r1=471486&r2=471487
==============================================================================
---
maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java
(original)
+++
maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java
Sun Nov 5 10:22:37 2006
@@ -1025,8 +1025,17 @@
*/
private String getDefaultFinalName( Artifact artifact )
{
- return artifact.getArtifactId() + "-" + artifact.getVersion() + "." +
- artifact.getArtifactHandler().getExtension();
+ String type = artifact.getType();
+ if ( "ejb-client".equals( type ) )
+ {
+ return artifact.getArtifactId() + "-" + artifact.getVersion() +
"-" + "client" + "." +
+ artifact.getArtifactHandler().getExtension();
+ }
+ else
+ {
+ return artifact.getArtifactId() + "-" + artifact.getVersion() +
"." +
+ artifact.getArtifactHandler().getExtension();
+ }
}
Modified:
maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoTest.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoTest.java?view=diff&rev=471487&r1=471486&r2=471487
==============================================================================
---
maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoTest.java
(original)
+++
maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoTest.java
Sun Nov 5 10:22:37 2006
@@ -405,6 +405,7 @@
File expectedWebSource2File = new File( webAppDirectory,
"org/web/app/last-exile.jsp" );
// final name form is <artifactId>-<version>.<type>
File expectedEJBArtifact = new File( webAppDirectory,
"WEB-INF/lib/ejbartifact-0.0-Test.jar" );
+ // File expectedEJBArtifact = new File( webAppDirectory,
"WEB-INF/lib/ejbartifact-0.0-Test.jar" );
assertTrue( "source files not found: " +
expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
assertTrue( "source files not found: " +
expectedWebSource2File.toString(), expectedWebSource2File.exists() );
@@ -478,7 +479,7 @@
File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
File expectedWebSource2File = new File( webAppDirectory,
"org/web/app/last-exile.jsp" );
// final name form is <artifactId>-<version>.<type>
- File expectedEJBArtifact = new File( webAppDirectory,
"WEB-INF/lib/ejbclientartifact-0.0-Test.jar" );
+ File expectedEJBArtifact = new File( webAppDirectory,
"WEB-INF/lib/ejbclientartifact-0.0-Test-client.jar" );
assertTrue( "source files not found: " +
expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
assertTrue( "source files not found: " +
expectedWebSource2File.toString(), expectedWebSource2File.exists() );