gpt4 book ai didi

org.codehaus.plexus.archiver.war.WarArchiver类的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 21:37:05 26 4
gpt4 key购买 nike

本文整理了Java中org.codehaus.plexus.archiver.war.WarArchiver类的一些代码示例,展示了WarArchiver类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WarArchiver类的具体详情如下:
包路径:org.codehaus.plexus.archiver.war.WarArchiver
类名称:WarArchiver

WarArchiver介绍

[英]An extension of <jar> to create a WAR archive. Contains special treatment for files that should end up in the WEB-INF/lib, WEB-INF/classes or WEB-INF directories of the Web Application Archive.

(The War task is a shortcut for specifying the particular layout of a WAR file. The same thing can be accomplished by using the prefix and fullpath attributes of zipfilesets in a Zip or Jar task.)

The extended zipfileset element from the zip task (with attributes prefix, fullpath, and src) is available in the War task.
[中]<jar>的扩展,用于创建战争档案。包含对应该在Web应用程序归档的WEB-INF/libWEB-INF/classesWEB-INF目录中结束的文件的特殊处理。
(War任务是指定War文件特定布局的快捷方式。在Zip或Jar任务中使用ZipFileSet的前缀和完整路径属性也可以实现同样的功能。)
zip任务中的扩展zipfileset元素(具有前缀、完整路径和src属性)在War任务中可用。

代码示例

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

/**
 * files to add under WEB-INF;
 */
public void addWebinf( File directoryName, String[] includes, String[] excludes )
  throws ArchiverException
{
  addDirectory( directoryName, "WEB-INF/", includes, excludes );
}

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

/**
 * set the deployment descriptor to use (WEB-INF/web.xml);
 * required unless <tt>update=true</tt>
 */
public void setWebxml( File descr )
  throws ArchiverException
{
  deploymentDescriptor = descr;
  if ( !deploymentDescriptor.exists() )
  {
    throw new ArchiverException( "Deployment descriptor: " + deploymentDescriptor + " does not exist." );
  }
  addFile( descr, "WEB-INF" + File.separatorChar + "web.xml" );
}

代码示例来源:origin: codehaus-cargo/cargo

WarArchiver warArchiver = new WarArchiver();
warArchiver.addDirectory(assembleDir);
warArchiver.setIgnoreWebxml(false);

代码示例来源:origin: org.apache.maven.plugins/maven-war-plugin

warArchiver.addDirectory( getWebappDirectory(), getPackagingIncludes(), getPackagingExcludes() );
  warArchiver.setWebxml( webXmlFile );
warArchiver.setRecompressAddedZips( isRecompressZippedFiles() );
warArchiver.setIncludeEmptyDirs( isIncludeEmptyDirectories() );
  warArchiver.setExpectWebXml( false );

代码示例来源:origin: org.apache.maven.plugin-testing/maven-plugin-testing-harness

war.setIgnoreWebxml( false );

代码示例来源:origin: tbroyer/gwt-maven-plugin

@Override
 public void execute() throws MojoExecutionException, MojoFailureException {
  warArchiver.setExpectWebXml(false);

  File warFile = new File(outputDirectory, warName + ".war");

  MavenArchiver archiver = new MavenArchiver();
  archiver.setArchiver(warArchiver);
  archiver.setOutputFile(warFile);

  archive.setForced(forceCreation);

  try {
   File prepackagedApp = new File(outputDirectory, warName);
   if (prepackagedApp.exists()) {
    warArchiver.addDirectory(prepackagedApp);
   }

   archiver.createArchive(session, project, archive);
  } catch (Exception e) {
   throw new MojoExecutionException("Error packaging GWT application", e);
  }

  project.getArtifact().setFile(warFile);
 }
}

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

/**
 * override of parent; validates configuration
 * before initializing the output stream.
 *
 * @param zOut
 */
@Override
protected void initZipOutputStream( ConcurrentJarCreator zOut )
  throws ArchiverException, IOException
{
  // If no webxml file is specified, it's an error.
  if ( expectWebXml && deploymentDescriptor == null && !isInUpdateMode() )
  {
    throw new ArchiverException(
      "webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)" );
  }
  super.initZipOutputStream( zOut );
}

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

deploymentDescriptor ) ) ) )
getLogger().warn( "Warning: selected " + archiveType
           + " files include a WEB-INF/web.xml which will be ignored "
           + "\n(webxml attribute is missing from "

代码示例来源:origin: org.apache.maven.plugins/maven-assembly-plugin

protected Archiver createWarArchiver()
  throws NoSuchArchiverException
{
  final WarArchiver warArchiver = (WarArchiver) archiverManager.getArchiver( "war" );
  warArchiver.setIgnoreWebxml( false ); // See MNG-1274
  return warArchiver;
}

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

/**
 * add files under WEB-INF/lib/
 */
public void addLibs( File directoryName, String[] includes, String[] excludes )
  throws ArchiverException
{
  addDirectory( directoryName, "WEB-INF/lib/", includes, excludes );
}

代码示例来源:origin: com.simpligility.org.apache.maven.plugin-testing/maven-plugin-testing-harness

war.setIgnoreWebxml( false );

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

/**
 * add files under WEB-INF/classes
 */
public void addClasses( File directoryName, String[] includes, String[] excludes )
  throws ArchiverException
{
  addDirectory( directoryName, "WEB-INF/classes/", includes, excludes );
}

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

/**
 * add a file under WEB-INF/lib/
 */
public void addLib( File fileName )
  throws ArchiverException
{
  addDirectory( fileName.getParentFile(), "WEB-INF/lib/",
         new String[]
         {
           fileName.getName()
         }, null );
}

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

/**
 * add a file under WEB-INF/lib/
 */
public void addClass( File fileName )
  throws ArchiverException
{
  addDirectory( fileName.getParentFile(), "WEB-INF/classes/",
         new String[]
         {
           fileName.getName()
         }, null );
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com