当前位置: 首页>>代码示例>>Java>>正文


Java MavenArchiveConfiguration类代码示例

本文整理汇总了Java中org.apache.maven.archiver.MavenArchiveConfiguration的典型用法代码示例。如果您正苦于以下问题:Java MavenArchiveConfiguration类的具体用法?Java MavenArchiveConfiguration怎么用?Java MavenArchiveConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MavenArchiveConfiguration类属于org.apache.maven.archiver包,在下文中一共展示了MavenArchiveConfiguration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseManifestConfiguration

import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private static ManifestConfiguration parseManifestConfiguration(BeanConfigurator beanConfigurator,
                                                                MavenProject project) throws MojoExecutionException {
  MavenArchiveConfiguration archiveConfiguration = new MavenArchiveConfiguration();

  BeanConfigurationRequest beanConfiguration = new DefaultBeanConfigurationRequest()
      .setBean(archiveConfiguration)
      .setConfiguration(project.getModel(), "org.apache.maven.plugins", "maven-jar-plugin", "default-jar");

  beanConfiguration.setConfiguration(beanConfiguration.getConfiguration(), "archive");

  try {
    beanConfigurator.configureBean(beanConfiguration);
  } catch (BeanConfigurationException e) {
    throw new MojoExecutionException("Error parsing archive configuration", e);
  }

  return archiveConfiguration.getManifest();
}
 
开发者ID:HubSpot,项目名称:SlimFast,代码行数:19,代码来源:ArtifactHelper.java

示例2: execute

import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
@Override
public void execute() throws MojoExecutionException {
    switch(type) {
    case runnable:
        if (mainClass == null) {
            throw new MojoExecutionException( "runnable archive need mainClass configured" );
        }
        MavenArchiveConfiguration archive = getArchive();
        archive.getManifest().setMainClass(mainClass);

        ArtifactHelper helper = new ArtifactHelper(unzip, system,
                                                   localRepository, getProject().getRemoteArtifactRepositories());
        File output = new File( getProject().getBuild().getOutputDirectory());
        helper.unzip(output, "org.jruby", "jruby-complete", jrubyVersion);
        helper.unzip(output, "org.jruby.mains", "jruby-mains", jrubyMainsVersion);

    case archive:
        break;
    default:
        throw new MojoExecutionException("can not pack archive " + type + " with jruby-jar-plugin");
    }
    
    super.execute();
}
 
开发者ID:torquebox,项目名称:jruby9-maven-plugins,代码行数:25,代码来源:JarMojo.java

示例3: addMultiReleaseManifestEntry

import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private void addMultiReleaseManifestEntry() throws MojoExecutionException {
    try {
        Field archive = AbstractJarMojo.class.getDeclaredField("archive");
        archive.setAccessible(true);
        MavenArchiveConfiguration config = (MavenArchiveConfiguration) archive.get(this);
        config.addManifestEntry("Multi-Release", "true");
    } catch (NoSuchFieldException | IllegalAccessException e) {
        throw new MojoExecutionException("Could not modify the archive configuration.", e);
    }
}
 
开发者ID:metlos,项目名称:multi-release-jar-maven-plugin,代码行数:11,代码来源:MrJarMojo.java

示例4: ArchiveTask

import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
public ArchiveTask(
		 MavenArchiveConfiguration archiveConfig	,JarArchiver lexArchiver
		,String classifier 
		
		,String id, String version, String name,String description
		,List<String> categories, Boolean trial
		,String luceeCoreVersion, String luceeLoaderVersion ,Boolean startBundles
		,List<? extends Config> cacheHandlers		,List<? extends Config> ormEngines
		,List<? extends Config>  monitors			,List<? extends Config> searchEngines
		,List<? extends Config> resourceProviders	,List<? extends Config> amfs
		,List<? extends Config> jdbcDrivers			,List<? extends Config> mappings
		,List<? extends Config> eventGateways
) {
	
	this.archiveConfig = archiveConfig;
	this.lexArchiver = lexArchiver;
	this.classifier = classifier;
	this.id = id;
	this.version = version;
	this.name = name;
	this.description = description;
	this.categories = categories;
	this.trial = trial;
	this.luceeCoreVersion = luceeCoreVersion;
	this.luceeLoaderVersion = luceeLoaderVersion;
	this.startBundles = startBundles;

	this.cacheHandlers = cacheHandlers;
	this.ormEngines = ormEngines;
	this.monitors = monitors;
	this.searchEngines = searchEngines;
	this.resourceProviders = resourceProviders;
	this.amfs = amfs;
	this.jdbcDrivers = jdbcDrivers;
	this.mappings = mappings;
	this.eventGateways = eventGateways;
}
 
开发者ID:dajester2013,项目名称:lucee-maven-plugin,代码行数:38,代码来源:ArchiveTask.java

示例5: getArchive

import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private MavenArchiveConfiguration getArchive() throws MojoExecutionException {
    try {
         Field archiveField = getClass().getSuperclass().getSuperclass().getDeclaredField("archive");
         archiveField.setAccessible(true);
         return (MavenArchiveConfiguration) archiveField.get(this);
    } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
        throw new MojoExecutionException("can not use reflection", e);
    }
}
 
开发者ID:torquebox,项目名称:jruby9-maven-plugins,代码行数:10,代码来源:JarMojo.java

示例6: packageCompiledSources

import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private void packageCompiledSources() throws DependencyResolutionRequiredException, IOException, ManifestException {
    MavenArchiver archiver = new MavenArchiver();
    archiver.setArchiver(sourcesArchiver);
    Path pluginJarFile = getDataOutputDirectory().resolve(PluginUtils.PLUGIN_IMPLEMENTATION_FILE);
    getLog().debug(String.format("Packing plugin sources to %s", pluginJarFile.toString()));
    archiver.setOutputFile(pluginJarFile.toFile());
    sourcesArchiver.addDirectory(compiledSourcesDir);
    archiver.createArchive(session, project, new MavenArchiveConfiguration());
}
 
开发者ID:meridor,项目名称:stecker,代码行数:10,代码来源:CreateMojo.java

示例7: packagePlugin

import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private void packagePlugin() throws DependencyResolutionRequiredException, IOException, ManifestException {
    MavenArchiver archiver = new MavenArchiver();
    archiver.setArchiver(pluginArchiver);
    Path pluginFile = getPluginFile();
    getLog().info(String.format("Creating plugin file: %s", pluginFile));
    archiver.setOutputFile(pluginFile.toFile());
    pluginArchiver.addDirectory(dataOutputDirectory);
    pluginArchiver.addConfiguredManifest(getPluginManifest());
    archiver.createArchive(session, project, new MavenArchiveConfiguration());
}
 
开发者ID:meridor,项目名称:stecker,代码行数:11,代码来源:CreateMojo.java

示例8: execute

import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
@Override
public void execute() throws MojoExecutionException, MojoFailureException {

	// Check the target file
	File modelDir = new File( this.project.getBuild().getOutputDirectory());
	if( ! modelDir.exists())
		throw new MojoExecutionException( "The model could not be found. " + modelDir );

	File targetDir = new File( this.project.getBuild().getDirectory());
	String archiveName = this.project.getBuild().getFinalName() + ".zip";
	File archiveFile = new File( targetDir, archiveName );

	// Configure the archive creation
	MavenArchiver archiver = new MavenArchiver();
	archiver.setArchiver( this.jarArchiver );
	archiver.setOutputFile( archiveFile );

	// Add the application directories
	try {
		archiver.getArchiver().addDirectory( modelDir );

		MavenArchiveConfiguration conf = new MavenArchiveConfiguration();
		conf.setCompress( true );

		archiver.createArchive( this.session, this.project, conf );
		this.project.getArtifact().setFile( archiveFile );

	} catch( Exception e ) {
		throw new MojoExecutionException( "Exception while packaging.", e );
	}
}
 
开发者ID:roboconf,项目名称:roboconf-maven-plugin,代码行数:32,代码来源:PackageMojo.java

示例9: JubeArchiveConfigurationSource

import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
public JubeArchiveConfigurationSource(MavenProject project, MavenSession mavenSession, MavenArchiveConfiguration archiveConfiguration,
                                      MavenFileFilter mavenFilter, String[] descriptors, String[] descriptorRefs) {
    this.project = project;
    this.mavenSession = mavenSession;
    this.archiveConfiguration = archiveConfiguration;
    this.mavenFilter = mavenFilter;
    this.descriptors = descriptors;
    this.descriptorRefs = descriptorRefs;
}
 
开发者ID:fabric8io,项目名称:jube,代码行数:10,代码来源:JubeArchiveConfigurationSource.java

示例10: createHeaderArchive

import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private void createHeaderArchive ( final CompileCommand compileCommand, final List<HeaderFilesDirective> finalHeaderFilesDirectives, final List<String> classifiers ) throws MojoExecutionException
{
    try
    {
        MavenArchiver mavenArchiver = new MavenArchiver();
        mavenArchiver.setArchiver( jarArchiver );

        final File jarFile = File.createTempFile( "tmp", ".har", buildDirectory );

        mavenArchiver.setOutputFile( jarFile );

        for ( HeaderFilesDirective headerFilesDirective : finalHeaderFilesDirectives )
        {
            mavenArchiver.getArchiver().addDirectory( new File( headerFilesDirective.getDirectory() ), headerFilesDirective.getIncludes(), headerFilesDirective.getExcludes() );
        }

        final MavenArchiveConfiguration mavenArchiveConfiguration = new MavenArchiveConfiguration();
        mavenArchiveConfiguration.setAddMavenDescriptor( false );

        mavenArchiver.createArchive( project, mavenArchiveConfiguration );

        for ( String classifier : classifiers )
        {
            getLog().debug( "Attaching 'har' classifier=" + classifier + " file=" + jarFile );
            projectHelper.attachArtifact( project, Const.ArtifactType.NATIVE_HEADER_ARCHIVE, classifier, jarFile );
        }

    }
    catch ( Exception e )
    {
        throw new MojoExecutionException( e.getMessage() );
    }
}
 
开发者ID:simpligility,项目名称:android-ndk-maven-plugin,代码行数:34,代码来源:NdkBuildMojo.java

示例11: perform

import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
@Override
public void perform(final DARMojoContext context) throws IOException {

    final Log log = context.getLog();
    final MavenArchiveConfiguration archiveConfiguration =
            context.getArchiveConfiguration();

    archiveConfiguration.getManifestEntries().put(
            "Diffusion-Version",
            context.getMinimumDiffusionVersion());

    log.debug("Manifest entries: " +
            archiveConfiguration.getManifestEntries());
}
 
开发者ID:pushtechnology,项目名称:mvndar,代码行数:15,代码来源:CreateManifestTask.java

示例12: getArchive

import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public MavenArchiveConfiguration getArchive()
{
    return archive;
}
 
开发者ID:zhegexiaohuozi,项目名称:maven-seimicrawler-plugin,代码行数:8,代码来源:AbstractWarMojo.java

示例13: addStringEntry

import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private void addStringEntry(MavenArchiveConfiguration archiveConfig, String key, String value) {
	if (value != null && !archiveConfig.getManifestEntries().containsKey(key)) {
		archiveConfig.addManifestEntry(key, '"' + value + '"');
	}
}
 
开发者ID:dajester2013,项目名称:lucee-maven-plugin,代码行数:6,代码来源:ArchiveTask.java

示例14: addBooleanEntry

import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private void addBooleanEntry(MavenArchiveConfiguration archiveConfig, String key, Boolean value) {
	if (value != null && !archiveConfig.getManifestEntries().containsKey(key)) {
		archiveConfig.addManifestEntry(key, String.valueOf(value));
	}
}
 
开发者ID:dajester2013,项目名称:lucee-maven-plugin,代码行数:6,代码来源:ArchiveTask.java

示例15: addConfigListEntry

import org.apache.maven.archiver.MavenArchiveConfiguration; //导入依赖的package包/类
private void addConfigListEntry(MavenArchiveConfiguration archiveConfig, String key, List<? extends Config> configs) {
	if (configs.size() > 0 && !archiveConfig.getManifestEntries().containsKey(key)) {
		archiveConfig.addManifestEntry(key, '"'+toJsonArray(configs)+'"');
	}
}
 
开发者ID:dajester2013,项目名称:lucee-maven-plugin,代码行数:6,代码来源:ArchiveTask.java


注:本文中的org.apache.maven.archiver.MavenArchiveConfiguration类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。