code: public void createArchive( File directory, File archive )
              throws MojoExecutionException
      {
  
          // package the zip. Note this is very simple. Look at the JarMojo which does more things.
          // we should perhaps package as a war when inside a project with war packaging ?
  
          makeDirectoryIfNecessary( archive.getParentFile() );
  
          deleteFile( archive );
  
          zipArchiver.addDirectory( directory );
          zipArchiver.setDestFile( archive );
  
          try
          {
              zipArchiver.createArchive();
          }
          catch ( IOException e )
          {
              throw new MojoExecutionException( "Could not create zip archive: " + archive, e );
          }
      }
docs: {@inheritDoc}