o Resolved MNG-692, although I think a more general solution is required;

o Fixed another boolean-logic error in the ear plugin.
  Stephane: (x != a) || (x != b) is always true, unless a == b.. ;-)


git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@227198 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Kenney Westerhof 2005-08-03 11:29:36 +00:00
parent 9508fdde65
commit 7a69f15c15
3 changed files with 19 additions and 6 deletions

View File

@ -47,7 +47,7 @@ public abstract class AbstractEarMojo
* @required
* @readonly
*/
private MavenProject project;
protected MavenProject project;
/**
* The ear modules configuration.
@ -106,9 +106,9 @@ public void execute()
// Artifact is not yet registered and it has neither test, nor a
// provided scope
if ( !isArtifactRegistered( artifact, earModules ) && (
!Artifact.SCOPE_TEST.equals( artifact.getScope() ) ||
!Artifact.SCOPE_PROVIDED.equals( artifact.getScope() ) ) )
if ( !isArtifactRegistered( artifact, earModules ) &&
!Artifact.SCOPE_TEST.equals( artifact.getScope() ) &&
!Artifact.SCOPE_PROVIDED.equals( artifact.getScope() )
{
EarModule module = EarModuleFactory.newEarModule( artifact );
earModules.add( module );

View File

@ -119,6 +119,15 @@ public void execute()
EarModule module = (EarModule) iter.next();
getLog().info( "Copying artifact[" + module + "] to[" + module.getUri() + "]" );
File destinationFile = buildDestinationFile( getBuildDir(), module.getUri() );
File sourceFile = module.getArtifact().getFile();
if ( !sourceFile.isFile() )
{
throw new MojoExecutionException( "Cannot copy a directory: " + sourceFile.getAbsolutePath() +
"; Did you package/install " + module.getArtifact().getId() + "?" );
}
FileUtils.copyFile( module.getArtifact().getFile(), destinationFile );
}
}
@ -158,6 +167,8 @@ public void execute()
archiver.getArchiver().addDirectory( getBuildDir() );
archiver.createArchive( getProject(), archive );
project.getArtifact().setFile( earFile );
}
catch ( Exception e )
{
@ -169,4 +180,4 @@ private static File buildDestinationFile( File buildDir, String uri )
{
return new File( buildDir, uri );
}
}
}

View File

@ -112,6 +112,8 @@ public void execute()
// create archive
archiver.createArchive( project, archive );
project.getArtifact().setFile( jarFile );
if ( new Boolean( generateClient ).booleanValue() )
{
getLog().info( "Building ejb client " + jarName + "-client" );
@ -145,4 +147,4 @@ public void execute()
}
}
}
}